From 891b3abb44f1a4a855510be70b2048ed955bbe17 Mon Sep 17 00:00:00 2001 From: substantialnoninfringinguser Date: Thu, 21 May 2009 19:47:19 +0100 Subject: [svn] Updates to allow subcave tree with nice admin. --- feincms/content/video/models.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 feincms/content/video/models.py (limited to 'feincms/content/video/models.py') diff --git a/feincms/content/video/models.py b/feincms/content/video/models.py new file mode 100644 index 0000000..f198235 --- /dev/null +++ b/feincms/content/video/models.py @@ -0,0 +1,26 @@ +from django.db import models +from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ +import re + +class VideoContent(models.Model): + video = models.URLField(_('video link'),help_text=_('This should be a link to a youtube video, i.e.: http://www.youtube.com/watch?v=zmj1rpzDRZ0')) + + class Meta: + abstract = True + verbose_name = _('video') + verbose_name_plural = _('videos') + + def render(self, **kwargs): + vid = re.search('(?<==)\w+',self.video) + ret = """ +
+ + + + + + +
+ """ % (vid.group(0), vid.group(0)) + return ret -- cgit v1.2.3