From 26ec1724a5bb44681db384fa13a3bd6457869f3c Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 26 Jan 2021 17:56:43 +0100 Subject: [PATCH] updating food working --- cookbook/serializer.py | 2 +- cookbook/templates/shopping_list.html | 63 ++++++++++++++++++++------- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/cookbook/serializer.py b/cookbook/serializer.py index a21ab9fe3..8695154f2 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -173,7 +173,7 @@ class SupermarketSerializer(UniqueFieldsMixin, serializers.ModelSerializer): class FoodSerializer(UniqueFieldsMixin, WritableNestedModelSerializer): - supermarket_category = SupermarketCategorySerializer(read_only=True) + supermarket_category = SupermarketCategorySerializer(allow_null=True) def create(self, validated_data): # since multi select tags dont have id's diff --git a/cookbook/templates/shopping_list.html b/cookbook/templates/shopping_list.html index 46a71205d..596ffd7a7 100644 --- a/cookbook/templates/shopping_list.html +++ b/cookbook/templates/shopping_list.html @@ -110,12 +110,15 @@ - -