Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use proper ModelAdmin for blog entry

  • Loading branch information...
commit c7511d81236f2a28019d8d8e103b03e0d1150e32 1 parent 425de86
@jphalip jphalip authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 django_website/blog/admin.py
View
11 django_website/blog/admin.py
@@ -4,9 +4,10 @@
from .models import Entry
-admin.site.register(Entry,
- list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author'),
- list_filter = ('is_active',),
- exclude = ('summary_html', 'body_html'),
+class EntryAdmin(admin.ModelAdmin):
+ list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
+ list_filter = ('is_active',)
+ exclude = ('summary_html', 'body_html')
prepopulated_fields = {"slug": ("headline",)}
-)
+
+admin.site.register(Entry, EntryAdmin)
Please sign in to comment.
Something went wrong with that request. Please try again.