from django.contrib import admin from . import models class ItemAdmin(admin.ModelAdmin): search_fields = ['title', 'description', 'url'] list_display = ['__str__', 'id', 'published'] list_filter = ( ("published", admin.EmptyFieldListFilter), ) admin.site.register(models.Item, ItemAdmin) class CommentAdmin(admin.ModelAdmin): search_fields = [ 'item__title', 'item__url', 'text', 'name', 'email' ] list_display = ['__str__', 'published'] list_filter = ( ("published", admin.EmptyFieldListFilter), ) admin.site.register(models.Comment, CommentAdmin)