X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/5629695bf0cb97b135eb076caf92e0382b2d8290..6770bddd884174b7e73a19ce63ea6b3954749b0e:/philo/contrib/penfield/admin.py diff --git a/philo/contrib/penfield/admin.py b/philo/contrib/penfield/admin.py index 0800be1..31aacb1 100644 --- a/philo/contrib/penfield/admin.py +++ b/philo/contrib/penfield/admin.py @@ -4,7 +4,9 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from philo.admin import EntityAdmin, COLLAPSE_CLASSES +from philo.admin.widgets import EmbedWidget from philo.contrib.penfield.models import BlogEntry, Blog, BlogView, Newsletter, NewsletterArticle, NewsletterIssue, NewsletterView +from philo.models.fields import TemplateField class DelayedDateForm(forms.ModelForm): @@ -41,6 +43,9 @@ class BlogEntryAdmin(EntityAdmin): ) related_lookup_fields = {'fk': raw_id_fields} prepopulated_fields = {'slug': ('title',)} + formfield_overrides = { + TemplateField: {'widget': EmbedWidget} + } class BlogViewAdmin(EntityAdmin): @@ -93,6 +98,9 @@ class NewsletterArticleAdmin(EntityAdmin): ) actions = ['make_issue'] prepopulated_fields = {'slug': ('title',)} + formfield_overrides = { + TemplateField: {'widget': EmbedWidget} + } def author_names(self, obj): return ', '.join([author.get_full_name() for author in obj.authors.all()])