X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/fb8a270fa22abc217efc471d860c76d5a2352c61..6de576dc999886f300c5abc74f4a2433a884d3b8:/philo/admin/forms/containers.py diff --git a/philo/admin/forms/containers.py b/philo/admin/forms/containers.py index 420ba17..0f8d117 100644 --- a/philo/admin/forms/containers.py +++ b/philo/admin/forms/containers.py @@ -1,11 +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 @@ -25,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. @@ -152,7 +152,7 @@ class ContainerInlineFormSet(BaseInlineFormSet): class ContentletInlineFormSet(ContainerInlineFormSet): def get_containers(self): try: - containers = list(self.instance.containers[0]) + containers = self.instance.containers[0] except ObjectDoesNotExist: containers = []