Improve admin interfaces.
This commit is contained in:
@@ -12,15 +12,15 @@ class IndexTemplateNodeInline(admin.StackedInline):
|
||||
model = IndexTemplateNode
|
||||
|
||||
|
||||
@admin.register(Index)
|
||||
class IndexAdmin(admin.ModelAdmin):
|
||||
filter_horizontal = ('document_types',)
|
||||
inlines = [IndexTemplateNodeInline]
|
||||
inlines = (IndexTemplateNodeInline,)
|
||||
list_display = ('label', 'enabled', 'get_document_types')
|
||||
|
||||
def get_document_types(self, instance):
|
||||
return ', '.join(['"{0}"'.format(document_type) for document_type in instance.document_types.all()]) or _('None')
|
||||
return ', '.join(
|
||||
['"{0}"'.format(document_type) for document_type in instance.document_types.all()]
|
||||
) or _('None')
|
||||
|
||||
get_document_types.short_description = _('Document types')
|
||||
|
||||
|
||||
admin.site.register(Index, IndexAdmin)
|
||||
|
||||
Reference in New Issue
Block a user