diff options
Diffstat (limited to 'app/jrnl/models.py')
-rw-r--r-- | app/jrnl/models.py | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 2fc775e..340b718 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -108,6 +108,7 @@ class Entry(models.Model): (5, 'double-black'), ) template_name = models.IntegerField(choices=TEMPLATES, default=0) + featured_image = models.ForeignKey(LuxImage, null=True, blank=True) class Meta: ordering = ('-pub_date',) @@ -194,41 +195,9 @@ class Entry(models.Model): self.location = Location.objects.filter(geometry__contains=self.point).get() except Location.DoesNotExist: raise forms.ValidationError("There is no location associated with that point, add it: %sadmin/locations/location/add/" % (settings.BASE_URL)) - super(Entry, self).save() - - -class EntryTitleSong(models.Model): - title = models.CharField(max_length=200, blank=True) - band = models.CharField(max_length=200) - album = models.CharField(max_length=200, blank=True, null=True) - song = models.CharField(max_length=200, blank=True, null=True) - listen_link = models.CharField(max_length=200, blank=True, null=True) - entry = models.ForeignKey(Entry) - slug = models.SlugField(unique_for_date='pub_date', blank=True) - body_markdown = models.TextField(blank=True) - body_html = models.TextField(blank=True) - pub_date = models.DateField('Date published') - - class Meta: - ordering = ('-pub_date',) - get_latest_by = 'pub_date' - verbose_name_plural = 'Entry Title Songs' - - def __str__(self): - return self.title - - def save(self): - if not self.id and not self.pub_date: - self.pub_date = datetime.datetime.now() - self.slug = slugify(self.title) - self.title = self.entry.title - super(EntryTitleSong, self).save() + super(Entry, self).save() -class EntryAside(models.Model): - title = models.CharField(max_length=200) - body = models.TextField(null=True, blank=True) - entry = models.ForeignKey(Entry) class HomepageCurrator(models.Model): |