-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
We should review our models on MongoDB to be able to make them proper for future developments. Also, we should add some models such as slots, absences.
class AbsenceModel(BaseModel):
id: PyObjectId = Field(default_factory=PyObjectId, alias="_id")
absence: str = Field(...)
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
json_encoders = {ObjectId: str}
schema_extra = {
"example": {
"absence": "1,0,2",
}
}
For example in here instead of putting absences as comma-separated strings, we can have attributes and while decoding and encoding we can change them as we want and use them properly. And with this way, we can be able to control those attributes in the model instead of endpoints.
Metadata
Metadata
Labels
No labels