Adding chtlawfirm to the api
This commit is contained in:
19
api/rpk-api/hub/core/__init__.py
Normal file
19
api/rpk-api/hub/core/__init__.py
Normal 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 ""
|
||||
Reference in New Issue
Block a user