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
|
2017-05-28 20:00:54 +00:00
|
|
|
fields = ('id', 'item', 'style')
|