1 from django.contrib import admin
2 from django.contrib.contenttypes import generic
3 from philo.models import Tag, Attribute
4 from philo.forms import AttributeForm
7 COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
10 class AttributeInline(generic.GenericTabularInline):
11 ct_field = 'entity_content_type'
12 ct_fk_field = 'entity_object_id'
15 template = 'admin/philo/edit_inline/tabular_attribute.html'
17 classes = COLLAPSE_CLASSES
19 exclude = ['value_object_id']
22 class EntityAdmin(admin.ModelAdmin):
23 inlines = [AttributeInline]
27 class TagAdmin(admin.ModelAdmin):
28 list_display = ('name', 'slug')
29 prepopulated_fields = {"slug": ("name",)}
31 admin.site.register(Tag, TagAdmin)