class EmployeeSerializerPrimaryKeyFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = PrimaryKeyField(Address) company = PrimaryKeyField(Company) department = PrimaryKeyField(Department)
class EmployeeSerializerNestedAttrsFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = NestedAttributesField(('id', 'street', 'number', 'city')) company = NestedAttributesField(('name', 'location')) department = NestedAttributesField(('name', ))
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 EmployeeSerializerCreationOnlyField(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) email = Field(creation_only=True)
class EmployeeInheritedModelSerializer(PolymorphicModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True)
class EmployeeSerializerProtectedField(ModelSerializer): _role = Field()
class EmployeeSerializerHybridProperty(ModelSerializer): full_name = Field(dump_only=True)
class EmployeeSerializerNestedModelFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = NestedModelField(Address) company = NestedModelField(Company)
class EmployeeSerializerNestedAttrsFields(ModelSerializer): password = Field(load_only=True) created_at = Field(dump_only=True) address = NestedAttributesField(("id", "street", "number", "city")) company = NestedAttributesField(("name", "location"))