bgneal@1: """ Newforms Admin configuration for Photologue bgneal@1: bgneal@1: """ bgneal@1: from django.contrib import admin bgneal@1: from models import * bgneal@1: bgneal@1: class GalleryAdmin(admin.ModelAdmin): bgneal@1: list_display = ('title', 'date_added', 'photo_count', 'is_public') bgneal@1: list_filter = ['date_added', 'is_public'] bgneal@1: date_hierarchy = 'date_added' bgneal@1: prepopulated_fields = {'title_slug': ('title',)} bgneal@1: filter_horizontal = ('photos',) bgneal@1: bgneal@1: class PhotoAdmin(admin.ModelAdmin): bgneal@1: list_display = ('title', 'date_taken', 'date_added', 'is_public', 'tags', 'view_count', 'admin_thumbnail') bgneal@1: list_filter = ['date_added', 'is_public'] bgneal@1: list_per_page = 10 bgneal@1: prepopulated_fields = {'title_slug': ('title',)} bgneal@1: bgneal@1: class PhotoEffectAdmin(admin.ModelAdmin): bgneal@1: list_display = ('name', 'description', 'admin_sample') bgneal@1: fieldsets = ( bgneal@1: (None, { bgneal@1: 'fields': ('name', 'description') bgneal@1: }), bgneal@1: ('Adjustments', { bgneal@1: 'fields': ('color', 'brightness', 'contrast', 'sharpness') bgneal@1: }), bgneal@1: ('Filters', { bgneal@1: 'fields': ('filters',) bgneal@1: }), bgneal@1: ('Reflection', { bgneal@1: 'fields': ('reflection_size', 'reflection_strength', 'background_color') bgneal@1: }), bgneal@1: ) bgneal@1: bgneal@1: class PhotoSizeAdmin(admin.ModelAdmin): bgneal@1: list_display = ('name', 'width', 'height', 'crop', 'pre_cache', 'effect', 'increment_count') bgneal@1: fieldsets = ( bgneal@1: (None, { bgneal@1: 'fields': ('name', 'width', 'height', 'quality') bgneal@1: }), bgneal@1: ('Options', { bgneal@1: 'fields': ('upscale', 'crop', 'pre_cache', 'increment_count') bgneal@1: }), bgneal@1: ('Enhancements', { bgneal@1: 'fields': ('effect', 'watermark',) bgneal@1: }), bgneal@1: ) bgneal@1: bgneal@1: class WatermarkAdmin(admin.ModelAdmin): bgneal@1: list_display = ('name', 'opacity', 'style') bgneal@1: bgneal@1: bgneal@1: admin.site.register(Gallery, GalleryAdmin) bgneal@1: admin.site.register(GalleryUpload) bgneal@1: admin.site.register(Photo, PhotoAdmin) bgneal@1: admin.site.register(PhotoEffect, PhotoEffectAdmin) bgneal@1: admin.site.register(PhotoSize, PhotoSizeAdmin) bgneal@1: admin.site.register(Watermark, WatermarkAdmin)