Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
adds django admin search, columns, sorting, and filters
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcz committed May 14, 2011
1 parent 024ddec commit f2eea98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/photos/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class PhotoAdmin( admin.ModelAdmin ):
form = PhotoChangeForm
#date_hierarchy = 'post_date'
prepopulated_fields = { 'slug' : ( 'title',) }
list_display = ('title','published','mod_date','post_date',)
list_editable = ('published',)
list_filter = ('post_date','published',)
search_fields = ('title','caption','post_date','slug',)
save_on_top = True
ordering = ('-post_date',)

# copied from the UserAdmin in django/contrib/auth/admin.py
def get_form( self, request, obj=None, **kwargs ):
Expand Down

0 comments on commit f2eea98

Please sign in to comment.