Skip to content

staff#

Exhibits models

StaffBase #

Bases: ZooModel

Staff model base

Source code in zoo/schemas/staff.py
class StaffBase(ZooModel):
    """
    Staff model base
    """

    name: str = Field(description="The name of the staff")
    job_title: Optional[str] = Field(
        default=None, description="The job title of the staff"
    )
    email: Optional[EmailStr] = Field(
        default=None, description="The email of the staff"
    )
    phone: Optional[str] = Field(
        default=None, description="The phone number of the staff"
    )
    notes: Optional[str] = Field(
        default=None, description="Optional notes regarding the staff member"
    )
    exhibit_id: Optional[int] = Field(description="The id of the exhibit", default=None)

    __example__: ClassVar[Dict[str, Any]] = {
        "name": "John Doe",
        "job_title": "Zookeeper",
        "email": "[email protected]",
        "phone": "555-555-5555",
        "notes": "John Doe is a great zookeeper and loves cats!",
        "exhibit_id": 1,
    }

StaffCreate #

Bases: StaffBase

Staff model: create

Source code in zoo/schemas/staff.py
class StaffCreate(StaffBase):
    """
    Staff model: create
    """

    model_config = ConfigDict(json_schema_extra=StaffBase.get_openapi_create_example())

StaffRead #

Bases: DeletedMixin, CreatedModifiedMixin, StaffBase, RequiredIdMixin

Staff model: read

Source code in zoo/schemas/staff.py
class StaffRead(
    DeletedMixin,
    CreatedModifiedMixin,
    StaffBase,
    RequiredIdMixin,
):
    """
    Staff model: read
    """

    model_config = ConfigDict(
        json_schema_extra=StaffBase.get_openapi_read_example(), from_attributes=True
    )

StaffUpdate #

Bases: ZooModel

Staff model: update

Source code in zoo/schemas/staff.py
class StaffUpdate(ZooModel):
    """
    Staff model: update
    """

    name: Optional[str] = Field(default=None, description="The name of the staff")
    job_title: Optional[str] = Field(
        default=None, description="The job title of the staff"
    )
    email: Optional[EmailStr] = Field(
        default=None, description="The email of the staff"
    )
    phone: Optional[str] = Field(
        default=None, description="The phone number of the staff"
    )
    notes: Optional[str] = Field(
        default=None, description="Optional notes regarding the staff member"
    )
    exhibit_id: Optional[int] = Field(description="The id of the exhibit", default=None)

    model_config = ConfigDict(json_schema_extra=StaffBase.get_openapi_update_example())