class EmployeeSerializer(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) company_name = Field(dump_only=True) address = NestedModelField(Address) contacts = NestedModelListField(Contact)
class EmployeeSerializerMixedFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = NestedAttributesField({ 'id': int, 'street': str, 'number': str, 'city': str }) company = NestedModelField(Company) department = PrimaryKeyField(Department)
class EmployeeSerializerNestedModelFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = NestedModelField(Address) company = NestedModelField(Company)
class AcordoLenienciaSerializer(ModelSerializer): empresa = NestedModelField(Empresa)