cookbook/recipes/admin.py

15 lines
370 B
Python
Raw Normal View History

2019-10-28 16:50:13 +01:00
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)