summaryrefslogtreecommitdiff
path: root/app/garden/admin.py
blob: 0f9c8d0a68a85a95d60b6b13bdb6bf6a282fd713 (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
35
36
37
38
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericStackedInline

from utils.widgets import AdminImageWidget, LGEntryForm
from .models import Plant, Planting, Seed


@admin.register(Plant)
class PlantAdmin(admin.ModelAdmin):
    form = LGEntryForm

    list_display = ('name', 'family', 'growth_time')
    list_filter = ('family', 'edible', 'conditions', 'heirloom')

    class Media:
        js = ('image-loader.js', 'next-prev-links.js')
        css = {
            "all": ("my_styles.css",)
        }


@admin.register(Planting)
class PlantingAdmin(admin.ModelAdmin):
    form = LGEntryForm

    list_display = ('plant', 'family', 'number_of_plants', 'date_seed_started', 'date_seed_sprouted', 'date_hardened_off',  'date_planted', 'seed_start_area','garden_area', 'outcome')
    list_filter = ('plant__family', 'date_seed_started', 'garden_area', 'seed_start_area', 'outcome')

    class Media:
        js = ('image-loader.js', 'next-prev-links.js')
        css = {
            "all": ("my_styles.css",)
        }


@admin.register(Seed)
class PlantAdmin(admin.ModelAdmin):
    form = LGEntryForm