-
Notifications
You must be signed in to change notification settings - Fork 0
/
serializers.py
36 lines (27 loc) · 885 Bytes
/
serializers.py
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
from rest_framework import serializers
from geodata.models import GeodataModelRu, GeodataModelRuAlternate
class GeodataModelRuSerializer(serializers.ModelSerializer):
class Meta:
model = GeodataModelRu
fields = (
'__all__'
)
class GeodataCitiesSerializer(serializers.ModelSerializer):
class Meta:
model = GeodataModelRu
fields = (
"geonameid", "name", "latitude", "longitude", "admin1code"
)
class GeodataCitiesSerializer2(serializers.ModelSerializer):
geonameid = GeodataCitiesSerializer()
class Meta:
model = GeodataModelRuAlternate
fields = (
"geonameid", "alternate_name", "isolanguage"
)
class GeodataCitiesSerializer3(serializers.ModelSerializer):
class Meta:
model = GeodataModelRu
fields = (
"__all__"
)