Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use proper ModelAdmin for blog entry

  • Loading branch information...
commit c7511d81236f2a28019d8d8e103b03e0d1150e32 1 parent 425de86
Julien Phalip authored May 10, 2011

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  django_website/blog/admin.py
11  django_website/blog/admin.py
@@ -4,9 +4,10 @@
4 4
 
5 5
 from .models import Entry
6 6
 
7  
-admin.site.register(Entry,
8  
-    list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author'),
9  
-    list_filter = ('is_active',),
10  
-    exclude = ('summary_html', 'body_html'),
  7
+class EntryAdmin(admin.ModelAdmin):
  8
+    list_display = ('headline', 'pub_date', 'is_active', 'is_published', 'author')
  9
+    list_filter = ('is_active',)
  10
+    exclude = ('summary_html', 'body_html')
11 11
     prepopulated_fields = {"slug": ("headline",)}
12  
-)
  12
+
  13
+admin.site.register(Entry, EntryAdmin)

0 notes on commit c7511d8

Please sign in to comment.
Something went wrong with that request. Please try again.