init
This commit is contained in:
13
recipe_book/admin.py
Normal file
13
recipe_book/admin.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Recipe,IngredientWithAmount, Ingredient
|
||||
# Register your models here.
|
||||
|
||||
class IngredientWithAmountInline(admin.TabularInline):
|
||||
model=IngredientWithAmount
|
||||
|
||||
class RecipeAdmin(admin.ModelAdmin):
|
||||
inlines = [ IngredientWithAmountInline, ]
|
||||
admin.site.register(Recipe, RecipeAdmin)
|
||||
|
||||
admin.site.register(Ingredient)
|
||||
Reference in New Issue
Block a user