1
0
Fork 0
spejstore-new/storage/serializers.py

16 lines
460 B
Python
Raw Normal View History

2017-04-28 12:14:27 +00:00
from storage.models import Item, Label
2017-03-06 15:50:55 +00:00
from rest_framework import serializers
from rest_framework_hstore.serializers import HStoreSerializer
class ItemSerializer(HStoreSerializer):
class Meta:
model = Item
fields = ('uuid', 'name', 'description', 'props', 'state', 'parent')
2017-04-28 12:14:27 +00:00
class LabelSerializer(serializers.ModelSerializer):
item = ItemSerializer()
class Meta:
model = Label
fields = ('id', 'item', 'revision')