renamed recipeingredient to ingredient
This commit is contained in:
parent
f685253645
commit
df912b8865
@ -50,11 +50,11 @@ admin.site.register(Unit)
|
|||||||
admin.site.register(Food)
|
admin.site.register(Food)
|
||||||
|
|
||||||
|
|
||||||
class RecipeIngredientAdmin(admin.ModelAdmin):
|
class IngredientAdmin(admin.ModelAdmin):
|
||||||
list_display = ('recipe', 'ingredient', 'amount', 'unit')
|
list_display = ('recipe', 'food', 'amount', 'unit')
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(RecipeIngredient, RecipeIngredientAdmin)
|
admin.site.register(Ingredient, IngredientAdmin)
|
||||||
|
|
||||||
|
|
||||||
class CommentAdmin(admin.ModelAdmin):
|
class CommentAdmin(admin.ModelAdmin):
|
||||||
|
@ -27,7 +27,7 @@ class RecipeFilter(django_filters.FilterSet):
|
|||||||
if not name == 'ingredients':
|
if not name == 'ingredients':
|
||||||
return queryset
|
return queryset
|
||||||
for x in value:
|
for x in value:
|
||||||
queryset = queryset.filter(recipeingredient__ingredient=x).distinct()
|
queryset = queryset.filter(ingredient__food=x).distinct()
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
24
cookbook/migrations/0057_auto_20200625_2127.py
Normal file
24
cookbook/migrations/0057_auto_20200625_2127.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2020-06-25 19:27
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cookbook', '0056_auto_20200625_2118'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='recipeingredient',
|
||||||
|
old_name='ingredient',
|
||||||
|
new_name='food',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='sharelink',
|
||||||
|
name='uuid',
|
||||||
|
field=models.UUIDField(default=uuid.UUID('4a604ec8-c158-4011-ab5d-ddad7604c1e3')),
|
||||||
|
),
|
||||||
|
]
|
23
cookbook/migrations/0058_auto_20200625_2128.py
Normal file
23
cookbook/migrations/0058_auto_20200625_2128.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2020-06-25 19:28
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cookbook', '0057_auto_20200625_2127'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameModel(
|
||||||
|
old_name='RecipeIngredient',
|
||||||
|
new_name='Ingredient',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='sharelink',
|
||||||
|
name='uuid',
|
||||||
|
field=models.UUIDField(default=uuid.UUID('27328011-54fb-46fa-8846-424d5828d858')),
|
||||||
|
),
|
||||||
|
]
|
@ -136,7 +136,7 @@ class Recipe(models.Model):
|
|||||||
link = models.CharField(max_length=512, null=True, blank=True)
|
link = models.CharField(max_length=512, null=True, blank=True)
|
||||||
cors_link = models.CharField(max_length=1024, null=True, blank=True)
|
cors_link = models.CharField(max_length=1024, null=True, blank=True)
|
||||||
keywords = models.ManyToManyField(Keyword, blank=True)
|
keywords = models.ManyToManyField(Keyword, blank=True)
|
||||||
ingredients = models.ManyToManyField('RecipeIngredient', blank=True, related_name='tmp_ingredients')
|
ingredients = models.ManyToManyField('Ingredient', blank=True, related_name='tmp_ingredients')
|
||||||
working_time = models.IntegerField(default=0)
|
working_time = models.IntegerField(default=0)
|
||||||
waiting_time = models.IntegerField(default=0)
|
waiting_time = models.IntegerField(default=0)
|
||||||
internal = models.BooleanField(default=False)
|
internal = models.BooleanField(default=False)
|
||||||
@ -164,15 +164,15 @@ class Food(models.Model):
|
|||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class RecipeIngredient(models.Model):
|
class Ingredient(models.Model):
|
||||||
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
|
recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE)
|
||||||
ingredient = models.ForeignKey(Food, on_delete=models.PROTECT)
|
food = models.ForeignKey(Food, on_delete=models.PROTECT)
|
||||||
unit = models.ForeignKey(Unit, on_delete=models.PROTECT)
|
unit = models.ForeignKey(Unit, on_delete=models.PROTECT)
|
||||||
amount = models.DecimalField(default=0, decimal_places=16, max_digits=32)
|
amount = models.DecimalField(default=0, decimal_places=16, max_digits=32)
|
||||||
note = models.CharField(max_length=64, null=True, blank=True)
|
note = models.CharField(max_length=64, null=True, blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.amount) + ' ' + str(self.unit) + ' ' + str(self.ingredient)
|
return str(self.amount) + ' ' + str(self.unit) + ' ' + str(self.food)
|
||||||
|
|
||||||
|
|
||||||
class Comment(models.Model):
|
class Comment(models.Model):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from cookbook.models import MealPlan, MealType, Recipe, ViewLog, UserPreference, Storage, Sync, SyncLog, Keyword, Unit, RecipeIngredient, Comment, RecipeImport, RecipeBook, RecipeBookEntry, ShareLink, CookLog, Food
|
from cookbook.models import MealPlan, MealType, Recipe, ViewLog, UserPreference, Storage, Sync, SyncLog, Keyword, Unit, Ingredient, Comment, RecipeImport, RecipeBook, RecipeBookEntry, ShareLink, CookLog, Food
|
||||||
from cookbook.templatetags.custom_tags import markdown
|
from cookbook.templatetags.custom_tags import markdown
|
||||||
|
|
||||||
|
|
||||||
@ -54,15 +54,15 @@ class UnitSerializer(serializers.ModelSerializer):
|
|||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class IngredientSerializer(serializers.ModelSerializer):
|
class FoodSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Food
|
model = Food
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class RecipeIngredientSerializer(serializers.ModelSerializer):
|
class IngredientSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RecipeIngredient
|
model = Ingredient
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,12 +154,12 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td style="vertical-align: middle!important;">
|
<td style="vertical-align: middle!important;">
|
||||||
{% if i.ingredient.recipe %}
|
{% if i.food.recipe %}
|
||||||
<a href="{% url 'view_recipe' i.ingredient.recipe.pk %}"
|
<a href="{% url 'view_recipe' i.food.recipe.pk %}"
|
||||||
target="_blank" rel="noopener noreferrer">
|
target="_blank" rel="noopener noreferrer">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ i.ingredient.name }}
|
{{ i.food.name }}
|
||||||
{% if i.ingredient.recipe %}
|
{% if i.food.recipe %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from django.contrib import auth
|
from django.contrib import auth
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from cookbook.models import Recipe, RecipeIngredient, Unit, Storage, Food
|
from cookbook.models import Recipe, Ingredient, Unit, Storage, Food
|
||||||
from cookbook.tests.views.test_views import TestViews
|
from cookbook.tests.views.test_views import TestViews
|
||||||
|
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class TestEditsRecipe(TestViews):
|
|||||||
{'name': 'Changed', 'working_time': 15, 'waiting_time': 15,
|
{'name': 'Changed', 'working_time': 15, 'waiting_time': 15,
|
||||||
'ingredients': '[{"ingredient__name":"Tomato","unit__name":"g","amount":100,"delete":false},{"ingredient__name":"Egg","unit__name":"Piece","amount":"2,5","delete":false}]'})
|
'ingredients': '[{"ingredient__name":"Tomato","unit__name":"g","amount":100,"delete":false},{"ingredient__name":"Egg","unit__name":"Piece","amount":"2,5","delete":false}]'})
|
||||||
self.assertEqual(r.status_code, 200)
|
self.assertEqual(r.status_code, 200)
|
||||||
self.assertEqual(2, RecipeIngredient.objects.filter(recipe=recipe).count())
|
self.assertEqual(2, Ingredient.objects.filter(recipe=recipe).count())
|
||||||
|
|
||||||
r = self.user_client_1.post(url,
|
r = self.user_client_1.post(url,
|
||||||
{'name': "Test", 'working_time': "Test", 'waiting_time': 15,
|
{'name': "Test", 'working_time': "Test", 'waiting_time': 15,
|
||||||
|
@ -11,8 +11,8 @@ from cookbook.helper import dal
|
|||||||
router = routers.DefaultRouter()
|
router = routers.DefaultRouter()
|
||||||
router.register(r'user-preference', api.UserPreferenceViewSet)
|
router.register(r'user-preference', api.UserPreferenceViewSet)
|
||||||
router.register(r'recipe', api.RecipeViewSet)
|
router.register(r'recipe', api.RecipeViewSet)
|
||||||
router.register(r'ingredient', api.IngredientViewSet)
|
router.register(r'food', api.FoodViewSet)
|
||||||
router.register(r'recipe-ingredient', api.RecipeIngredientViewSet)
|
router.register(r'recipe-ingredient', api.IngredientViewSet)
|
||||||
router.register(r'meal-plan', api.MealPlanViewSet)
|
router.register(r'meal-plan', api.MealPlanViewSet)
|
||||||
router.register(r'meal-type', api.MealTypeViewSet)
|
router.register(r'meal-type', api.MealTypeViewSet)
|
||||||
router.register(r'view-log', api.ViewLogViewSet)
|
router.register(r'view-log', api.ViewLogViewSet)
|
||||||
|
@ -18,10 +18,10 @@ from rest_framework.mixins import RetrieveModelMixin, UpdateModelMixin, ListMode
|
|||||||
|
|
||||||
from cookbook.helper.permission_helper import group_required, CustomIsOwner, CustomIsAdmin, CustomIsUser
|
from cookbook.helper.permission_helper import group_required, CustomIsOwner, CustomIsAdmin, CustomIsUser
|
||||||
from cookbook.helper.recipe_url_import import get_from_html
|
from cookbook.helper.recipe_url_import import get_from_html
|
||||||
from cookbook.models import Recipe, Sync, Storage, CookLog, MealPlan, MealType, ViewLog, UserPreference, RecipeBook, RecipeIngredient, Food
|
from cookbook.models import Recipe, Sync, Storage, CookLog, MealPlan, MealType, ViewLog, UserPreference, RecipeBook, Ingredient, Food
|
||||||
from cookbook.provider.dropbox import Dropbox
|
from cookbook.provider.dropbox import Dropbox
|
||||||
from cookbook.provider.nextcloud import Nextcloud
|
from cookbook.provider.nextcloud import Nextcloud
|
||||||
from cookbook.serializer import MealPlanSerializer, MealTypeSerializer, RecipeSerializer, ViewLogSerializer, UserNameSerializer, UserPreferenceSerializer, RecipeBookSerializer, RecipeIngredientSerializer, IngredientSerializer
|
from cookbook.serializer import MealPlanSerializer, MealTypeSerializer, RecipeSerializer, ViewLogSerializer, UserNameSerializer, UserPreferenceSerializer, RecipeBookSerializer, IngredientSerializer, FoodSerializer
|
||||||
|
|
||||||
|
|
||||||
class UserNameViewSet(viewsets.ModelViewSet):
|
class UserNameViewSet(viewsets.ModelViewSet):
|
||||||
@ -134,15 +134,15 @@ class RecipeViewSet(viewsets.ModelViewSet):
|
|||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
class RecipeIngredientViewSet(viewsets.ModelViewSet):
|
class IngredientViewSet(viewsets.ModelViewSet):
|
||||||
queryset = RecipeIngredient.objects.all()
|
queryset = Ingredient.objects.all()
|
||||||
serializer_class = RecipeIngredientSerializer
|
serializer_class = IngredientSerializer
|
||||||
permission_classes = [CustomIsUser]
|
permission_classes = [CustomIsUser]
|
||||||
|
|
||||||
|
|
||||||
class IngredientViewSet(viewsets.ModelViewSet):
|
class FoodViewSet(viewsets.ModelViewSet):
|
||||||
queryset = Food.objects.all()
|
queryset = Food.objects.all()
|
||||||
serializer_class = IngredientSerializer
|
serializer_class = FoodSerializer
|
||||||
permission_classes = [CustomIsUser]
|
permission_classes = [CustomIsUser]
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ def import_url(request):
|
|||||||
# TODO return proper error
|
# TODO return proper error
|
||||||
pass
|
pass
|
||||||
|
|
||||||
RecipeIngredient.objects.create(recipe=recipe, ingredient=i, unit=u, amount=ing['amount'])
|
Ingredient.objects.create(recipe=recipe, ingredient=i, unit=u, amount=ing['amount'])
|
||||||
|
|
||||||
if data['image'] != '':
|
if data['image'] != '':
|
||||||
response = requests.get(data['image'])
|
response = requests.get(data['image'])
|
||||||
|
@ -19,7 +19,7 @@ from cookbook.forms import ExternalRecipeForm, KeywordForm, StorageForm, SyncFor
|
|||||||
from cookbook.helper.permission_helper import group_required, GroupRequiredMixin
|
from cookbook.helper.permission_helper import group_required, GroupRequiredMixin
|
||||||
|
|
||||||
from cookbook.helper.permission_helper import OwnerRequiredMixin
|
from cookbook.helper.permission_helper import OwnerRequiredMixin
|
||||||
from cookbook.models import Recipe, Sync, Keyword, RecipeImport, Storage, Comment, RecipeIngredient, RecipeBook, \
|
from cookbook.models import Recipe, Sync, Keyword, RecipeImport, Storage, Comment, Ingredient, RecipeBook, \
|
||||||
MealPlan, Unit, Food
|
MealPlan, Unit, Food
|
||||||
from cookbook.provider.dropbox import Dropbox
|
from cookbook.provider.dropbox import Dropbox
|
||||||
from cookbook.provider.nextcloud import Nextcloud
|
from cookbook.provider.nextcloud import Nextcloud
|
||||||
@ -83,10 +83,10 @@ def internal_recipe_update(request, pk):
|
|||||||
except simplejson.errors.JSONDecodeError:
|
except simplejson.errors.JSONDecodeError:
|
||||||
form_ingredients = []
|
form_ingredients = []
|
||||||
|
|
||||||
RecipeIngredient.objects.filter(recipe=recipe_instance).delete()
|
Ingredient.objects.filter(recipe=recipe_instance).delete()
|
||||||
|
|
||||||
for i in form_ingredients:
|
for i in form_ingredients:
|
||||||
recipe_ingredient = RecipeIngredient()
|
recipe_ingredient = Ingredient()
|
||||||
recipe_ingredient.recipe = recipe_instance
|
recipe_ingredient.recipe = recipe_instance
|
||||||
|
|
||||||
if 'note' in i:
|
if 'note' in i:
|
||||||
@ -95,10 +95,10 @@ def internal_recipe_update(request, pk):
|
|||||||
if Food.objects.filter(name=i['ingredient__name']).exists():
|
if Food.objects.filter(name=i['ingredient__name']).exists():
|
||||||
recipe_ingredient.ingredient = Food.objects.get(name=i['ingredient__name'])
|
recipe_ingredient.ingredient = Food.objects.get(name=i['ingredient__name'])
|
||||||
else:
|
else:
|
||||||
ingredient = Food()
|
food = Food()
|
||||||
ingredient.name = i['ingredient__name']
|
food.name = i['food__name']
|
||||||
ingredient.save()
|
food.save()
|
||||||
recipe_ingredient.ingredient = ingredient
|
recipe_ingredient.ingredient = food
|
||||||
|
|
||||||
if isinstance(i['amount'], str):
|
if isinstance(i['amount'], str):
|
||||||
try:
|
try:
|
||||||
@ -127,7 +127,7 @@ def internal_recipe_update(request, pk):
|
|||||||
else:
|
else:
|
||||||
form = InternalRecipeForm(instance=recipe_instance)
|
form = InternalRecipeForm(instance=recipe_instance)
|
||||||
|
|
||||||
ingredients = RecipeIngredient.objects.select_related('unit__name', 'ingredient__name').filter(recipe=recipe_instance).values('ingredient__name', 'unit__name', 'amount', 'note').order_by('id')
|
ingredients = Ingredient.objects.select_related('unit__name', 'food__name').filter(recipe=recipe_instance).values('food__name', 'unit__name', 'amount', 'note').order_by('id')
|
||||||
|
|
||||||
return render(request, 'forms/edit_internal_recipe.html',
|
return render(request, 'forms/edit_internal_recipe.html',
|
||||||
{'form': form, 'ingredients': json.dumps(list(ingredients)),
|
{'form': form, 'ingredients': json.dumps(list(ingredients)),
|
||||||
@ -181,7 +181,7 @@ class FoodUpdate(GroupRequiredMixin, UpdateView):
|
|||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(FoodUpdate, self).get_context_data(**kwargs)
|
context = super(FoodUpdate, self).get_context_data(**kwargs)
|
||||||
context['title'] = _("Ingredient")
|
context['title'] = _("Food")
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ def edit_ingredients(request):
|
|||||||
if units_form.is_valid():
|
if units_form.is_valid():
|
||||||
new_unit = units_form.cleaned_data['new_unit']
|
new_unit = units_form.cleaned_data['new_unit']
|
||||||
old_unit = units_form.cleaned_data['old_unit']
|
old_unit = units_form.cleaned_data['old_unit']
|
||||||
recipe_ingredients = RecipeIngredient.objects.filter(unit=old_unit).all()
|
recipe_ingredients = Ingredient.objects.filter(unit=old_unit).all()
|
||||||
for i in recipe_ingredients:
|
for i in recipe_ingredients:
|
||||||
i.unit = new_unit
|
i.unit = new_unit
|
||||||
i.save()
|
i.save()
|
||||||
@ -338,7 +338,7 @@ def edit_ingredients(request):
|
|||||||
if ingredients_form.is_valid():
|
if ingredients_form.is_valid():
|
||||||
new_ingredient = ingredients_form.cleaned_data['new_food']
|
new_ingredient = ingredients_form.cleaned_data['new_food']
|
||||||
old_ingredient = ingredients_form.cleaned_data['old_food']
|
old_ingredient = ingredients_form.cleaned_data['old_food']
|
||||||
recipe_ingredients = RecipeIngredient.objects.filter(ingredient=old_ingredient).all()
|
recipe_ingredients = Ingredient.objects.filter(food=old_ingredient).all()
|
||||||
for i in recipe_ingredients:
|
for i in recipe_ingredients:
|
||||||
i.ingredient = new_ingredient
|
i.ingredient = new_ingredient
|
||||||
i.save()
|
i.save()
|
||||||
|
@ -12,7 +12,7 @@ from django.urls import reverse_lazy
|
|||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
from cookbook.forms import ExportForm, ImportForm
|
from cookbook.forms import ExportForm, ImportForm
|
||||||
from cookbook.helper.permission_helper import group_required
|
from cookbook.helper.permission_helper import group_required
|
||||||
from cookbook.models import RecipeIngredient, Recipe, Unit, Food, Keyword, Food
|
from cookbook.models import Ingredient, Recipe, Unit, Food, Keyword, Food
|
||||||
|
|
||||||
|
|
||||||
@group_required('user')
|
@group_required('user')
|
||||||
@ -47,7 +47,7 @@ def import_recipe(request):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
for ri in data['recipe_ingredients']:
|
for ri in data['recipe_ingredients']:
|
||||||
RecipeIngredient.objects.create(recipe=recipe, ingredient=Food.objects.get(name=ri['ingredient']),
|
Ingredient.objects.create(recipe=recipe, ingredient=Food.objects.get(name=ri['food']),
|
||||||
unit=Unit.objects.get(name=ri['unit']), amount=ri['amount'], note=ri['note'])
|
unit=Unit.objects.get(name=ri['unit']), amount=ri['amount'], note=ri['note'])
|
||||||
|
|
||||||
if data['image']:
|
if data['image']:
|
||||||
@ -84,13 +84,13 @@ def export_recipe(request):
|
|||||||
for k in recipe.keywords.all():
|
for k in recipe.keywords.all():
|
||||||
export['keywords'].append({'name': k.name, 'icon': k.icon, 'description': k.description})
|
export['keywords'].append({'name': k.name, 'icon': k.icon, 'description': k.description})
|
||||||
|
|
||||||
for ri in RecipeIngredient.objects.filter(recipe=recipe).all():
|
for ri in Ingredient.objects.filter(recipe=recipe).all():
|
||||||
if ri.unit not in export['units']:
|
if ri.unit not in export['units']:
|
||||||
export['units'].append({'name': ri.unit.name, 'description': ri.unit.description})
|
export['units'].append({'name': ri.unit.name, 'description': ri.unit.description})
|
||||||
if ri.ingredient not in export['ingredients']:
|
if ri.ingredient not in export['ingredients']:
|
||||||
export['ingredients'].append({'name': ri.ingredient.name})
|
export['ingredients'].append({'name': ri.ingredient.name})
|
||||||
|
|
||||||
export['recipe_ingredients'].append({'ingredient': ri.ingredient.name, 'unit': ri.unit.name, 'amount': float(ri.amount), 'note': ri.note})
|
export['recipe_ingredients'].append({'food': ri.ingredient.name, 'unit': ri.unit.name, 'amount': float(ri.amount), 'note': ri.note})
|
||||||
|
|
||||||
if recipe.image and form.cleaned_data['image']:
|
if recipe.image and form.cleaned_data['image']:
|
||||||
with open(recipe.image.path, 'rb') as img_f:
|
with open(recipe.image.path, 'rb') as img_f:
|
||||||
|
@ -79,7 +79,7 @@ def recipe_view(request, pk, share=None):
|
|||||||
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
|
messages.add_message(request, messages.ERROR, _('You do not have the required permissions to view this page!'))
|
||||||
return HttpResponseRedirect(reverse('index'))
|
return HttpResponseRedirect(reverse('index'))
|
||||||
|
|
||||||
ingredients = RecipeIngredient.objects.filter(recipe=recipe).all()
|
ingredients = Ingredient.objects.filter(recipe=recipe).all()
|
||||||
comments = Comment.objects.filter(recipe=recipe)
|
comments = Comment.objects.filter(recipe=recipe)
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
Loading…
Reference in New Issue
Block a user