Set NodeAdmin to bypass MPTTModelAdmin's formfield_for_foreignkey method.
[philo.git] / admin / collections.py
1 from django.contrib import admin
2 from philo.admin.base import COLLAPSE_CLASSES
3 from philo.models import CollectionMember, Collection
4
5
6 class CollectionMemberInline(admin.TabularInline):
7         fk_name = 'collection'
8         model = CollectionMember
9         extra = 1
10         classes = COLLAPSE_CLASSES
11         allow_add = True
12         fields = ('member_content_type', 'member_object_id', 'index')
13         sortable_field_name = 'index'
14
15
16 class CollectionAdmin(admin.ModelAdmin):
17         inlines = [CollectionMemberInline]
18         list_display = ('name', 'description', 'get_count')
19
20
21 admin.site.register(Collection, CollectionAdmin)