Fixed api's list bug

This commit is contained in:
Antoine Bartuccio 2016-08-19 17:25:23 +02:00
parent 6c107ed3d4
commit 2f7030d964
2 changed files with 9 additions and 5 deletions

View File

@ -11,12 +11,14 @@ class CounterSerializer(serializers.ModelSerializer):
is_open = serializers.BooleanField(read_only=True)
barman_list = serializers.ListField(
child=serializers.IntegerField()
child=serializers.IntegerField(),
read_only=True
)
class Meta:
model = Counter
fields = ('id', 'name', 'type', 'is_open', 'barman_list')
fields = ('id', 'name', 'type', 'club',
'products', 'is_open', 'barman_list')
class CounterViewSet(RightModelViewSet):

View File

@ -9,10 +9,12 @@ from api.views import RightModelViewSet
class LaunderettePlaceSerializer(serializers.ModelSerializer):
machine_list = serializers.ListField(
child=serializers.IntegerField()
child=serializers.IntegerField(),
read_only=True
)
token_list = serializers.ListField(
child=serializers.IntegerField()
child=serializers.IntegerField(),
read_only=True
)
class Meta:
@ -24,7 +26,7 @@ class LaunderetteMachineSerializer(serializers.ModelSerializer):
class Meta:
model = Machine
fields = ('id', 'name', 'is_working', 'launderette')
fields = ('id', 'name', 'type', 'is_working', 'launderette')
class LaunderetteTokenSerializer(serializers.ModelSerializer):