You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
from rest_framework import serializers
|
|
|
|
from service import models
|
|
from service.service import PointService
|
|
|
|
|
|
class PlacementPointSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = models.PlacementPoint
|
|
fields = '__all__'
|
|
|
|
|
|
class PrePlacementPointSerializer(PlacementPointSerializer):
|
|
class Meta:
|
|
model = models.PrePlacementPoint
|
|
fields = '__all__'
|
|
|
|
|
|
class PostAndPVZGroupSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = models.Post_and_pvzGroup
|
|
fields = '__all__'
|
|
|
|
|
|
class PostAndPVZCategorySerializer(serializers.ModelSerializer):
|
|
groups = PostAndPVZGroupSerializer(read_only=True, many=True)
|
|
|
|
class Meta:
|
|
model = models.Post_and_pvzCategory
|
|
fields = '__all__'
|
|
|
|
|
|
class OtherObjectsGroupSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = models.OtherObjectsGroup
|
|
fields = '__all__'
|
|
|
|
|
|
class OtherObjectsCategorySerializer(serializers.ModelSerializer):
|
|
groups = OtherObjectsGroupSerializer(many=True, read_only=True)
|
|
|
|
class Meta:
|
|
model = models.OtherObjectsCategory
|
|
fields = '__all__'
|
|
|
|
|
|
class RayonSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = models.AO
|
|
fields = '__all__'
|
|
|
|
|
|
class AOSerializer(serializers.ModelSerializer):
|
|
rayons = RayonSerializer(many=True, read_only=True)
|
|
|
|
class Meta:
|
|
model = models.AO
|
|
fields = '__all__'
|