From 09c1ac39bdca24789061191be1728ae7f7d9c8ef Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Wed, 6 Sep 2017 01:23:04 +0200 Subject: [PATCH] Fix label insertion --- storage/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/serializers.py b/storage/serializers.py index 859b95a..0fd9699 100644 --- a/storage/serializers.py +++ b/storage/serializers.py @@ -10,6 +10,7 @@ class ItemSerializer(HStoreSerializer): class LabelSerializer(serializers.ModelSerializer): item = ItemSerializer() + item_id = serializers.PrimaryKeyRelatedField(queryset=Item.objects, source='item') class Meta: model = Label - fields = ('id', 'item', 'style') + fields = ('id', 'item', 'item_id', 'style')