summaryrefslogtreecommitdiff
path: root/app/sketches/admin.py
blob: 9f3c087153e7edd6b69afd5595382e651e9082a2 (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
33
34
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import Sketch
from utils.widgets import LGEntryForm, OLAdminBase


@admin.register(Sketch)
class SketchAdmin(OLAdminBase):
    form = LGEntryForm

    prepopulated_fields = {"slug": ('title',)}
    list_display = ('title', 'slug', 'pub_date', 'location')
    fieldsets = (
        ('Note', {
            'fields': (
                ('title', 'slug'),
                'body_markdown',
                ('pub_date', 'status'),
                'point'
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }
        ),
    )
    class Media:
        js = ('image-loader.js',)