Make item field non-required on LabelSerializer
This commit is contained in:
parent
427da3e35c
commit
67a2446123
|
@ -9,7 +9,7 @@ class ItemSerializer(HStoreSerializer):
|
||||||
fields = ('uuid', 'name', 'description', 'props', 'state', 'parent')
|
fields = ('uuid', 'name', 'description', 'props', 'state', 'parent')
|
||||||
|
|
||||||
class LabelSerializer(serializers.ModelSerializer):
|
class LabelSerializer(serializers.ModelSerializer):
|
||||||
item = ItemSerializer()
|
item = ItemSerializer(required=False)
|
||||||
item_id = serializers.PrimaryKeyRelatedField(queryset=Item.objects, source='item')
|
item_id = serializers.PrimaryKeyRelatedField(queryset=Item.objects, source='item')
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Label
|
model = Label
|
||||||
|
|
Loading…
Reference in New Issue