Switching foreign jkey to PydanticObjectId

This commit is contained in:
2025-04-16 22:38:06 +02:00
parent 15b77ff09f
commit 5bdb754f1c
5 changed files with 16 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ from datetime import date, datetime
from typing import List, Literal, Optional
from pydantic import Field, BaseModel
from beanie import Indexed
from beanie import Indexed, PydanticObjectId
from firm.core.models import CrudDocument
from firm.core.filter import Filter, FilterSchema
@@ -39,7 +39,7 @@ class Individual(EntityType):
class Employee(BaseModel):
position: Indexed(str) = Field(title='Poste')
entity_id: str = Field(
entity_id: PydanticObjectId = Field(
foreignKey={
"reference": {
"resource": "entity",