diff options
Diffstat (limited to 'bak/unused_apps/people/models.py')
-rw-r--r-- | bak/unused_apps/people/models.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/bak/unused_apps/people/models.py b/bak/unused_apps/people/models.py index 1a07b16..538c9b3 100644 --- a/bak/unused_apps/people/models.py +++ b/bak/unused_apps/people/models.py @@ -1,27 +1,26 @@ 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) + last_name = models.CharField(max_length=200, null=True, blank=True) email = models.EmailField(max_length=120, null=True, blank=True) + address = models.TextField(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) + 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) + notes = models.TextField(null=True, blank=True) location_met = models.ForeignKey(Location, on_delete=models.CASCADE, null=True, blank=True) + contact_frequency = models.BigIntegerField(help_text="In days") next_contact_date = models.DateField(null=True, blank=True) + date_added = models.DateField(auto_now_add=True) class Meta: ordering = ('-last_name',) @@ -30,7 +29,7 @@ class Person(models.Model): return "%s %s" %(self.first_name, self.last_name) def get_absolute_url(self): - return reverse("people:detail", kwargs={"slug": self.slug}) + return reverse("people:detail", kwargs={"pk": self.pk}) @property def get_previous_admin_url(self): @@ -46,9 +45,5 @@ class Person(models.Model): 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() |