from django.utils.safestring import mark_safe
from django.utils.html import escape
from django.utils.text import truncate_words
-from models import *
+from philo.models import *
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from validators import TreeParentValidator, TreePositionValidator
extra = 1
classes = ('collapse-closed',)
allow_add = True
+ fields = ('member_content_type', 'member_object_id', 'index',)
class CollectionAdmin(admin.ModelAdmin):
for container_name, container_content_type in contentreference_containers:
if ('contentreference_container_%s' % container_name) in form.cleaned_data:
content = form.cleaned_data[('contentreference_container_%s' % container_name)]
+ if content == None:
+ continue
contentreference, created = page.contentreferences.get_or_create(name=container_name, defaults={'content': content})
if not created:
contentreference.content = content