Cocktail-DB/cocktail_list/admin.py

15 lines
447 B
Python
Raw Normal View History

2020-05-25 09:49:36 +00:00
from django.contrib import admin
2020-06-03 13:45:22 +00:00
from .models import Ingredienti,Cocktail,Strumenti,Bicchieri
2020-05-25 09:49:36 +00:00
# Register your models here.
2020-06-03 13:45:22 +00:00
class CocktailModel(admin.ModelAdmin):
model = Cocktail
list_display = ('nome_cocktail','lista_ingredienti')
search_fields = ["nome_cocktail","ingredienti__ingrediente"]
2020-05-25 09:49:36 +00:00
admin.site.register(Ingredienti)
2020-06-03 13:45:22 +00:00
admin.site.register(Strumenti)
admin.site.register(Bicchieri)
admin.site.register(Cocktail,CocktailModel)