view user_photos/admin.py @ 697:67f8d49a9377

Cleaned up the code a bit. Separated the S3 stuff out into its own class. This class maybe should be in core. Still want to do some kind of context manager around the temporary file we are creating to ensure it gets deleted.
author Brian Neal <bgneal@gmail.com>
date Sun, 08 Sep 2013 21:02:58 -0500
parents 2d35e5f97a99
children d7a0aaabc06c
line wrap: on
line source
"""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)