cookbook/recipes/admin.py
2019-10-28 16:52:22 +01:00

14 lines
370 B
Python

from django.contrib import admin
from .models import Recipe, Ingredient, IngredientUsage
class IngredientUsageInline(admin.TabularInline):
model = IngredientUsage
extra = 1
class RecipeAdmin(admin.ModelAdmin):
inlines = (IngredientUsageInline,)
fields = [ 'name', 'protocol' ]
admin.site.register(Recipe,RecipeAdmin)
admin.site.register(Ingredient)