Add last_updated field to Thoughts

This commit is contained in:
Matthias Portzel 2023-12-12 13:30:43 -05:00
parent d4e10810f8
commit 43abe234fb
1 changed files with 2 additions and 0 deletions

View File

@ -19,9 +19,11 @@ class Thought(models.Model):
media = models.FileField(upload_to="", blank=True) # A single image, video, or sound clip per post
media_alt = models.TextField(blank=True) # An optional transcription of the Thought's media
html_content = models.TextField(blank=True) # The rendered text for this thought
last_updated = models.DateTimeField(default=timezone.now)
def save(self):
self.update_html_content(commit=False)
self.last_updated = timezone.now()
super().save()
def get_media_type(self):