forked from OpenTreeMap/otm-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
30 lines (21 loc) · 777 Bytes
/
admin.py
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 treekey.models import Node, Species, SpeciesImage, NodeImage, SpeciesLink
from django.contrib import admin
class SpeciesImageInline(admin.TabularInline):
model = SpeciesImage
extra = 0
class SpeciesLinkInline(admin.TabularInline):
model = SpeciesLink
extra = 0
class SpeciesInline(admin.TabularInline):
model = Species
class NodeImageInline(admin.TabularInline):
model = NodeImage
extra = 0
class NodeAdmin(admin.ModelAdmin):
inlines = [NodeImageInline]
list_display = ('name', 'description')
class SpeciesAdmin(admin.ModelAdmin):
inlines = [SpeciesImageInline, SpeciesLinkInline]
list_display = ('genus', 'species', 'common_name')
admin.site.register(Node, NodeAdmin)
admin.site.register(Species, SpeciesAdmin)