Skip to content
Snippets Groups Projects
Commit 8a913adf authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Fix filter by EnumField

See merge request !8
parents b06f1f40 65baa826
No related branches found
No related tags found
1 merge request!8Fix filter by EnumField
from django.contrib import admin
from documents.models import Page, Document, DocumentLink, Section, Transcription
from enumfields.admin import EnumFieldListFilter
class PageAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'page_type', 'nb', 'direction', )
list_filter = ('page_type', )
list_filter = [('page_type', EnumFieldListFilter)]
fields = ('id', 'name', 'folio', 'page_type', 'nb', 'direction', 'image')
readonly_fields = ('id', )
......@@ -17,7 +18,7 @@ class DocumentLinkAdmin(admin.TabularInline):
class DocumentAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'type')
list_filter = ('type', )
list_filter = [('type', EnumFieldListFilter)]
fields = ('id', 'type', 'name')
readonly_fields = ('id', )
inlines = [DocumentLinkAdmin, ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment