summaryrefslogtreecommitdiff
path: root/app/garden/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/garden/admin.py')
-rw-r--r--app/garden/admin.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/app/garden/admin.py b/app/garden/admin.py
new file mode 100644
index 0000000..0f9c8d0
--- /dev/null
+++ b/app/garden/admin.py
@@ -0,0 +1,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