-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathadmin.py
32 lines (22 loc) · 950 Bytes
/
admin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Copyright (c) 2008, Myles Braithwaite
All rights reserved.
This software is provided without warranty under the terms of the BSD
license included in photos/LICENSE.markdown and may be redistributed only under
the conditions described in the aforementioned license. This license is also
available online at http://code.google.com/p/django-photo-gallery/wiki/License
Author: Myles Braithwaite
"""
from django.contrib import admin
from photos.models import Module, Gallery, Photo
class ModuleAdmin(admin.ModelAdmin):
list_display = ('module_type', 'site',)
admin.site.register(Module, ModuleAdmin)
class GalleryAdmin(admin.ModelAdmin):
list_display = ('title',)
prepopulated_fields = {'slug': ('title',)}
admin.site.register(Gallery, GalleryAdmin)
class PhotoAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('title',)}
list_display = ('title', 'gallery', 'location', 'favorite')
admin.site.register(Photo, PhotoAdmin)