Fix label insertion

This commit is contained in:
Piotr Dobrowolski 2017-09-06 01:23:04 +02:00
parent 98313721b9
commit 09c1ac39bd
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ class ItemSerializer(HStoreSerializer):
class LabelSerializer(serializers.ModelSerializer): class LabelSerializer(serializers.ModelSerializer):
item = ItemSerializer() item = ItemSerializer()
item_id = serializers.PrimaryKeyRelatedField(queryset=Item.objects, source='item')
class Meta: class Meta:
model = Label model = Label
fields = ('id', 'item', 'style') fields = ('id', 'item', 'item_id', 'style')