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