serializers.py
1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from api.models import Device, Video, Lock, RemoteHistory, Record, Door, AddDevice
from rest_framework import serializers
class DoorSerializer(serializers.ModelSerializer) :
class Meta :
model = Door
fields = '__all__'
class DeviceSerializer(serializers.ModelSerializer) :
class Meta :
model = Device
fields = '__all__'
class VideoSerializer(serializers.ModelSerializer) :
class Meta :
model = Video
fields = '__all__'
class RemoteHistorySerializer(serializers.ModelSerializer) :
class Meta :
model = RemoteHistory
fields = '__all__'
class RecordSerializer(serializers.ModelSerializer) :
class Meta :
model = Record
fields = '__all__'
class LockSerializer(serializers.ModelSerializer) :
class Meta :
model = Lock
fields = '__all__'
class AddDeviceSerializer(serializers.ModelSerializer) :
class Meta :
model = AddDevice
fields = '__all__'