Overrides TemplateField widget on admin container forms instead of on the ModelAdmin.
authorStephen Burrows <stephen.r.burrows@gmail.com>
Fri, 15 Jul 2011 19:24:10 +0000 (15:24 -0400)
committerStephen Burrows <stephen.r.burrows@gmail.com>
Fri, 15 Jul 2011 19:24:10 +0000 (15:24 -0400)
philo/admin/forms/containers.py
philo/admin/pages.py

index 987524f..0f8d117 100644 (file)
@@ -1,12 +1,11 @@
 from django import forms
-from django.contrib.admin.widgets import AdminTextareaWidget
 from django.core.exceptions import ObjectDoesNotExist
 from django.db.models import Q
 from django.forms.models import ModelForm, BaseInlineFormSet, BaseModelFormSet
 from django.forms.formsets import TOTAL_FORM_COUNT
 from django.utils.datastructures import SortedDict
 
-from philo.admin.widgets import ModelLookupWidget
+from philo.admin.widgets import ModelLookupWidget, EmbedWidget
 from philo.models import Contentlet, ContentReference
 
 
@@ -26,7 +25,7 @@ class ContainerForm(ModelForm):
 
 
 class ContentletForm(ContainerForm):
-       content = forms.CharField(required=False, widget=AdminTextareaWidget, label='Content')
+       content = forms.CharField(required=False, widget=EmbedWidget, label='Content')
        
        def should_delete(self):
                # Delete iff: the data has changed and is now empty.
index 96951c9..4cdd37b 100644 (file)
@@ -15,9 +15,6 @@ class ContainerInline(admin.StackedInline):
        max_num = 0
        can_delete = False
        classes = ('collapse-open', 'collapse','open')
-       formfield_overrides = {
-               TemplateField: {'widget': EmbedWidget}
-       }
        if 'grappelli' in settings.INSTALLED_APPS:
                template = 'admin/philo/edit_inline/grappelli_tabular_container.html'
        else: