diff options
Diffstat (limited to 'app/essays/models.py')
-rw-r--r-- | app/essays/models.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/essays/models.py b/app/essays/models.py index 23a4cce..6160165 100644 --- a/app/essays/models.py +++ b/app/essays/models.py @@ -20,19 +20,11 @@ POST_TYPE = ( ) -class PostType(models.Model): - name = models.CharField(max_length=200) - dek = models.TextField(blank=True) - slug = models.SlugField() - - def __str__(self): - return self.name - - class Essay(models.Model): title = models.CharField(max_length=200) sub_title = models.CharField(max_length=200, blank=True) dek = models.TextField(blank=True) + preamble = models.TextField(blank=True) slug = models.SlugField(unique_for_date='pub_date') body_html = models.TextField(blank=True) body_markdown = models.TextField() @@ -46,7 +38,6 @@ class Essay(models.Model): ) status = models.IntegerField(choices=PUB_STATUS, default=0) meta_description = models.CharField(max_length=256, null=True, blank=True) - post_type = models.IntegerField(choices=POST_TYPE, default=0) tags = TaggableManager(through=TaggedItems, blank=True, help_text='Topics Covered') originally_published_by = models.CharField(max_length=400, blank=True) originally_published_by_url = models.CharField(max_length=400, blank=True) @@ -66,7 +57,7 @@ class Essay(models.Model): return self.title def get_absolute_url(self): - return "/%s/%s" % (self.get_post_type_display(), self.slug) + return reverse('essays:detail', kwargs={"slug": self.slug}) def comment_period_open(self): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date |