Mercurial > public > sg101
diff user_photos/admin.py @ 695:2d35e5f97a99
In process work for #50. Started a user_photos application.
Initial commit with model, form, and view. The view doesn't save the photo yet.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 20:50:46 -0500 |
parents | |
children | d7a0aaabc06c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/user_photos/admin.py Sat Sep 07 20:50:46 2013 -0500 @@ -0,0 +1,13 @@ +"""Admin definitions for the user_photos application.""" +from django.contrib import admin + +from user_photos.models import Photo + + +class PhotoAdmin(admin.ModelAdmin): + date_hierarchy = 'upload_date' + ordering = ['-upload_date'] + raw_id_fields = ['user'] + search_fields = ['user__username', 'user__email'] + +admin.site.register(Photo, PhotoAdmin)