carom-server/billard/serializers.py

19 lines
513 B
Python
Raw Normal View History

2017-01-03 19:55:01 +01:00
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')