Sith/api/views/serializers.py
2016-08-07 20:45:06 +02:00

16 lines
386 B
Python

from rest_framework import serializers
from counter.models import Counter
class Counter(serializers.ModelSerializer):
is_open = serializers.BooleanField(read_only=True)
barman_list = serializers.ListField(
child = serializers.IntegerField()
)
class Meta:
model = Counter
fields = ('id', 'name', 'type', 'is_open', 'barman_list')