1 from django.contrib import admin
2 from django.contrib.contenttypes import generic
3 from philo.models import Tag, Attribute, Relationship
6 COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
9 class AttributeInline(generic.GenericTabularInline):
10 ct_field = 'entity_content_type'
11 ct_fk_field = 'entity_object_id'
14 template = 'admin/philo/edit_inline/tabular_collapse.html'
18 class RelationshipInline(generic.GenericTabularInline):
19 ct_field = 'entity_content_type'
20 ct_fk_field = 'entity_object_id'
23 template = 'admin/philo/edit_inline/tabular_collapse.html'
27 class EntityAdmin(admin.ModelAdmin):
28 inlines = [AttributeInline, RelationshipInline]
32 class TagAdmin(admin.ModelAdmin):
33 prepopulated_fields = {"slug": ("name",)}
35 admin.site.register(Tag, TagAdmin)