19 lines
513 B
Python
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') |