1 from django.contrib import admin
2 #from django.contrib.contenttypes.models import ContentType
3 from django.contrib.contenttypes import generic
4 #from django import forms
5 #from django.conf import settings
6 #from django.utils.translation import ugettext as _
7 #from django.utils.safestring import mark_safe
8 #from django.utils.html import escape
9 #from django.utils.text import truncate_words
10 from philo.models import *
11 #from philo.admin import widgets
12 #from django.core.exceptions import ValidationError, ObjectDoesNotExist
13 #from validators import TreeParentValidator, TreePositionValidator
16 COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
19 class AttributeInline(generic.GenericTabularInline):
20 ct_field = 'entity_content_type'
21 ct_fk_field = 'entity_object_id'
24 template = 'admin/philo/edit_inline/tabular_collapse.html'
28 class RelationshipInline(generic.GenericTabularInline):
29 ct_field = 'entity_content_type'
30 ct_fk_field = 'entity_object_id'
33 template = 'admin/philo/edit_inline/tabular_collapse.html'
37 class EntityAdmin(admin.ModelAdmin):
38 inlines = [AttributeInline, RelationshipInline]