diff options
author | luxagraf <sng@luxagraf.net> | 2020-12-02 15:02:12 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-12-02 15:02:12 -0500 |
commit | ab8055b5cab2523d925f59c65bc38df103a26991 (patch) | |
tree | 29e4597bc0d86d658f574c0c4f0b036351a68742 /app/unused_apps/people/models.py | |
parent | 87f692178a6e30719c564076f00c206642f36ce6 (diff) |
deleted old apps and media
Diffstat (limited to 'app/unused_apps/people/models.py')
-rw-r--r-- | app/unused_apps/people/models.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/app/unused_apps/people/models.py b/app/unused_apps/people/models.py deleted file mode 100644 index 1a07b16..0000000 --- a/app/unused_apps/people/models.py +++ /dev/null @@ -1,54 +0,0 @@ -from django.db import models -from django.template.defaultfilters import slugify - -from taggit.managers import TaggableManager -from locations.models import Location -from utils.util import markdown_to_html - - -class Person(models.Model): - first_name = models.CharField(max_length=200) - last_name = models.CharField(max_length=200) - email = models.EmailField(max_length=120, null=True, blank=True) - street = models.CharField(max_length=355, null=True, blank=True) - city = models.CharField(max_length=200, null=True, blank=True) - state = models.CharField(max_length=200, null=True, blank=True) - postal_code = models.CharField(max_length=20, null=True, blank=True) - country = models.CharField(max_length=200, null=True) - phone = models.CharField(max_length=22, blank=True, null=True) - slug = models.CharField(max_length=50, blank=True) - body_markdown = models.TextField(null=True, blank=True) - body_html = models.TextField(null=True, blank=True) - tags = TaggableManager(blank=True) - location_met = models.ForeignKey(Location, on_delete=models.CASCADE, null=True, blank=True) - next_contact_date = models.DateField(null=True, blank=True) - - class Meta: - ordering = ('-last_name',) - - def __str__(self): - return "%s %s" %(self.first_name, self.last_name) - - def get_absolute_url(self): - return reverse("people:detail", kwargs={"slug": self.slug}) - - @property - def get_previous_admin_url(self): - n = self.get_previous_by_pub_date() - return reverse('admin:%s_%s_change' %(self._meta.app_label, self._meta.model_name), args=[n.id] ) - - @property - def get_next_admin_url(self): - model = apps.get_model(app_label=self._meta.app_label, model_name=self._meta.model_name) - try: - return reverse('admin:%s_%s_change' %(self._meta.app_label, self._meta.model_name), args=[self.get_next_by_pub_date().pk] ) - except model.DoesNotExist: - return '' - - def save(self, *args, **kwargs): - if not self.slug: - self.slug = slugify(("%s-%s")[:50] %(self.last_name, self.first_name)) - if self.body_markdown: - self.body_html = markdown_to_html(self.body_markdown) - super(Person, self).save() - |