27 lines
676 B
Python
27 lines
676 B
Python
from billard.models import *
|
|
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',)
|
|
|
|
|
|
class LocationDataSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = LocationData
|
|
fields = ('location_id', 'table_no', 'tst', 'on_off',)
|