summaryrefslogtreecommitdiff
path: root/app/birds/admin.py
blob: 01a6f4c71a7b8ebe6e1d4f8f0441596e91cc084c (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
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from birds.models import BirdSighting, BirdClass, Bird


class BirdClassAdmin(admin.ModelAdmin):
    list_display = ('common_name', 'scientific_name',)


class BirdAdmin(admin.ModelAdmin):
    list_display = ('pk', 'common_name', 'scientific_name', 'code', 'bird_class')


class BirdSightingAdmin(OSMGeoAdmin):
    list_display = ('bird', 'location')
    list_filter = ('location',)
    # options for OSM map Using custom ESRI topo map
    default_lon = -9285175
    default_lat = 4025046
    default_zoom = 6
    units = True
    scrollable = False
    map_width = 700
    map_height = 425
    map_template = 'gis/admin/osm.html'
    openlayers_url = '/static/admin/js/OpenLayers.js'

admin.site.register(BirdSighting, BirdSightingAdmin)
admin.site.register(BirdClass, BirdClassAdmin)
admin.site.register(Bird, BirdAdmin)