You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin.py 654B

12345678910111213141516171819
  1. from django.contrib import admin
  2. from django.contrib.flatpages.forms import FlatpageForm
  3. from django.contrib.flatpages.models import FlatPage
  4. from django.utils.translation import gettext_lazy as _
  5. @admin.register(FlatPage)
  6. class FlatPageAdmin(admin.ModelAdmin):
  7. form = FlatpageForm
  8. fieldsets = (
  9. (None, {'fields': ('url', 'title', 'content', 'sites')}),
  10. (_('Advanced options'), {
  11. 'classes': ('collapse',),
  12. 'fields': ('registration_required', 'template_name'),
  13. }),
  14. )
  15. list_display = ('url', 'title')
  16. list_filter = ('sites', 'registration_required')
  17. search_fields = ('url', 'title')