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
33
34
35
36
37
38
|
from django.contrib import admin
from django import forms
from django.contrib.gis.admin import OSMGeoAdmin
from django.conf.urls import url
from django.utils.translation import ungettext, ugettext_lazy as _
from .models import LuxImage, LuxGallery, LuxImageSize, LuxVideo
from django.shortcuts import render
from django.contrib.admin import helpers
from django.http import HttpResponseRedirect
class LuxImageSizeAdmin(OSMGeoAdmin):
list_display = ('name', 'width', 'height', 'quality')
pass
admin.site.register(LuxImageSize, LuxImageSizeAdmin)
@admin.register(LuxVideo)
class LuxVideoAdmin(OSMGeoAdmin):
pass
@admin.register(LuxImage)
class LuxImageAdmin(OSMGeoAdmin):
list_display = ('pk', 'admin_thumbnail', 'pub_date', 'caption')
list_filter = ('pub_date',)
search_fields = ['title', 'caption']
# Options for OSM map Using custom ESRI topo map
fieldsets = (
(None, {
'fields': ('title', ('image'), 'pub_date', 'sizes', 'alt', 'caption', ('is_public'), ('photo_credit_source', 'photo_credit_url'))
}),
)
class Media:
js = ('image-preview.js', 'next-prev-links.js')
|