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.
 
 
 
 
 
 

74 lines
1.7 KiB

from rest_framework.serializers import ModelSerializer
from .models import Project, Realty, BuildingClassfication, ConstructionType
from common.serializers import LocationSerializer
from specializations.serializers import SpecializationSerializer
from users.serializers import UserSerializer
class BuildingClassficationSerializer(ModelSerializer):
class Meta:
model = BuildingClassfication
fields = (
'id',
'name',
)
class ConstructionTypeSerializer(ModelSerializer):
class Meta:
model = ConstructionType
fields = (
'id',
'name',
)
class RealtySerializer(ModelSerializer):
building_classification = BuildingClassficationSerializer()
construction_type = ConstructionTypeSerializer()
location = LocationSerializer()
user = UserSerializer()
class Meta:
model = Realty
fields = (
'building_classification',
'construction_type',
'id',
'location',
'name',
'user',
)
class ProjectSerializer(ModelSerializer):
customer = UserSerializer()
specialization = SpecializationSerializer()
realty = RealtySerializer()
class Meta:
model = Project
fields = (
'budget',
'budget_by_agreement',
'created',
'cro',
'currency',
'customer',
'deal_type',
'id',
'name',
'price_and_term_required',
'realty',
'specialization',
'state',
'term',
'term_type',
'text',
'work_type',
)