comparison mysite/photologue/admin.py @ 1:0dcfcdf50c62

Initial import of Madeira project from the private repository.
author Brian Neal <bgneal@gmail.com>
date Mon, 06 Apr 2009 03:10:59 +0000
parents
children
comparison
equal deleted inserted replaced
0:df0370bfe3f0 1:0dcfcdf50c62
1 """ Newforms Admin configuration for Photologue
2
3 """
4 from django.contrib import admin
5 from models import *
6
7 class GalleryAdmin(admin.ModelAdmin):
8 list_display = ('title', 'date_added', 'photo_count', 'is_public')
9 list_filter = ['date_added', 'is_public']
10 date_hierarchy = 'date_added'
11 prepopulated_fields = {'title_slug': ('title',)}
12 filter_horizontal = ('photos',)
13
14 class PhotoAdmin(admin.ModelAdmin):
15 list_display = ('title', 'date_taken', 'date_added', 'is_public', 'tags', 'view_count', 'admin_thumbnail')
16 list_filter = ['date_added', 'is_public']
17 list_per_page = 10
18 prepopulated_fields = {'title_slug': ('title',)}
19
20 class PhotoEffectAdmin(admin.ModelAdmin):
21 list_display = ('name', 'description', 'admin_sample')
22 fieldsets = (
23 (None, {
24 'fields': ('name', 'description')
25 }),
26 ('Adjustments', {
27 'fields': ('color', 'brightness', 'contrast', 'sharpness')
28 }),
29 ('Filters', {
30 'fields': ('filters',)
31 }),
32 ('Reflection', {
33 'fields': ('reflection_size', 'reflection_strength', 'background_color')
34 }),
35 )
36
37 class PhotoSizeAdmin(admin.ModelAdmin):
38 list_display = ('name', 'width', 'height', 'crop', 'pre_cache', 'effect', 'increment_count')
39 fieldsets = (
40 (None, {
41 'fields': ('name', 'width', 'height', 'quality')
42 }),
43 ('Options', {
44 'fields': ('upscale', 'crop', 'pre_cache', 'increment_count')
45 }),
46 ('Enhancements', {
47 'fields': ('effect', 'watermark',)
48 }),
49 )
50
51 class WatermarkAdmin(admin.ModelAdmin):
52 list_display = ('name', 'opacity', 'style')
53
54
55 admin.site.register(Gallery, GalleryAdmin)
56 admin.site.register(GalleryUpload)
57 admin.site.register(Photo, PhotoAdmin)
58 admin.site.register(PhotoEffect, PhotoEffectAdmin)
59 admin.site.register(PhotoSize, PhotoSizeAdmin)
60 admin.site.register(Watermark, WatermarkAdmin)