Adding chtlawfirm to the api

This commit is contained in:
2025-04-10 22:43:00 +02:00
parent 72a8e7fb91
commit 93255c60a9
33 changed files with 1647 additions and 43 deletions

View File

@@ -0,0 +1,19 @@
from datetime import datetime
from beanie import Document, PydanticObjectId
from pydantic import Field, computed_field
class CrudDocument(Document):
_id: str
created_at: datetime = Field(default=datetime.utcnow(), nullable=False, title="Créé le")
created_by: PydanticObjectId = Field()
updated_at: datetime = Field(default_factory=datetime.utcnow, nullable=False, title="Modifié le")
updated_by: PydanticObjectId = Field()
@computed_field
def label(self) -> str:
return self.compute_label()
def compute_label(self) -> str:
return ""