from django.contrib import admin
from .models import Fertilizer, FertilizationPlan, FertilizationEntry


@admin.register(Fertilizer)
class FertilizerAdmin(admin.ModelAdmin):
    list_display = ['name', 'maker', 'capacity_kg', 'nitrogen_pct']


class FertilizationEntryInline(admin.TabularInline):
    model = FertilizationEntry
    extra = 0


@admin.register(FertilizationPlan)
class FertilizationPlanAdmin(admin.ModelAdmin):
    list_display = ['name', 'year', 'variety']
    list_filter = ['year']
    inlines = [FertilizationEntryInline]
