carom-server/billard/serializers.py
2017-01-03 19:55:12 +01:00

19 lines
513 B
Python

from billard.models import Client, Location, Table
from rest_framework import serializers
class ClientSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Client
fields = ('id', 'location')
class LocationSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Location
fields = ('name')
class TableSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Table
fields = ('client', 'number', 'name')