summaryrefslogtreecommitdiff
path: root/app/photos/admin.py
blob: 072808c5c122f625482d16835c0ac430d8239ccf (plain)
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
from django.contrib import admin
from photos.models import LuxImage, LuxImageSize, LuxVideo


@admin.register(LuxImageSize)
class LuxImageSizeAdmin(admin.ModelAdmin):
    list_display = ('name', 'width', 'height', 'quality')


@admin.register(LuxVideo)
class LuxVideoAdmin(admin.ModelAdmin):
    pass


@admin.register(LuxImage)
class LuxImageAdmin(admin.ModelAdmin):
    list_display = ('pk', 'admin_thumbnail', 'pub_date', 'caption')
    list_filter = ('pub_date',)
    search_fields = ['title', 'caption']

    fieldsets = (
        (None, {
            'fields': ('title', ('image'), 'pub_date', 'sizes', 'alt', 'caption', ('is_public'), ('photo_credit_source', 'photo_credit_url'))
        }),
        ('Exif Data', {
            'classes': ('collapse',),
            'fields': ('height', 'width'),
        }),
    )

    class Media:
        js = ('image-preview.js', 'next-prev-links.js')