renamed ingredient to food

This commit is contained in:
vabene1111
2020-06-25 21:24:03 +02:00
parent 2c5e44d73c
commit f685253645
22 changed files with 83 additions and 54 deletions

View File

@ -1,6 +1,6 @@
from dal import autocomplete
from cookbook.models import Keyword, RecipeIngredient, Recipe, Unit, Ingredient
from cookbook.models import Keyword, Recipe, Unit, Food
class KeywordAutocomplete(autocomplete.Select2QuerySetView):
@ -19,9 +19,9 @@ class KeywordAutocomplete(autocomplete.Select2QuerySetView):
class IngredientsAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
if not self.request.user.is_authenticated:
return Ingredient.objects.none()
return Food.objects.none()
qs = Ingredient.objects.all()
qs = Food.objects.all()
if self.q:
qs = qs.filter(name__icontains=self.q)