Adding chtlawfirm to the api
This commit is contained in:
18
api/rpk-api/firm/core/schemas.py
Normal file
18
api/rpk-api/firm/core/schemas.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Optional
|
||||
|
||||
from beanie import PydanticObjectId
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Reader(BaseModel):
|
||||
id: Optional[PydanticObjectId] = Field(default=None, validation_alias="_id")
|
||||
|
||||
@classmethod
|
||||
def from_model(cls, model):
|
||||
schema = cls.model_validate(model, from_attributes=True)
|
||||
return schema
|
||||
|
||||
|
||||
class Writer(BaseModel):
|
||||
async def validate_foreign_key(self, db):
|
||||
pass
|
||||
Reference in New Issue
Block a user