summaryrefslogtreecommitdiff
path: root/app/jrnl/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/jrnl/models.py')
-rw-r--r--app/jrnl/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index 20d753f..254662d 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -20,7 +20,7 @@ from bs4 import BeautifulSoup
from photos.models import PhotoGallery, LuxImage
from locations.models import Location
-from utils.widgets import parse_image
+from utils.widgets import parse_image, parse_video
from utils.widgets import markdown_to_html
@@ -82,6 +82,7 @@ class Entry(models.Model):
)
template_name = models.IntegerField(choices=TEMPLATES, default=0)
featured_image = models.ForeignKey(LuxImage, null=True, blank=True)
+ #has_video = models.BooleanField(blank=True, default=False)
class Meta:
ordering = ('-pub_date',)
@@ -164,6 +165,7 @@ class Entry(models.Model):
else:
md = image_url_replace(self.body_markdown)
self.body_html = markdown.markdown(md, extensions=['extra'], safe_mode=False)
+ self.has_video = parse_video(self.body_html)
self.dek = markdown_to_html(self.dek)
try:
self.location = Location.objects.filter(geometry__contains=self.point).get()