Source

dvd-collection / collection / admin.py

Full commit
Kevin Veroneau 80dc35b 
Kevin Veroneau 3cbfa43 
Kevin Veroneau 80dc35b 









Kevin Veroneau 3cbfa43 


Kevin Veroneau 80dc35b 


Kevin Veroneau 3cbfa43 
from django.contrib import admin
from collection.models import Genre, Movie, Director, Watchlist

class GenreAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('name',)}

class MovieAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'format', 'genre', 'watched', 'added_on',)
    list_filter = ('format', 'genre',)
    search_fields = ['title',]
    prepopulated_fields = {'slug': ('title',)}

class WatchlistAdmin(admin.ModelAdmin):
    filter_horizontal = ('movies', 'genres',)

admin.site.register(Genre, GenreAdmin)
admin.site.register(Movie, MovieAdmin)
admin.site.register(Director)
admin.site.register(Watchlist, WatchlistAdmin)