now the defaults work??
This commit is contained in:
parent
cd3e240f6b
commit
dd5443a961
@ -1,4 +1,4 @@
|
|||||||
from pydantic import model_validator, UUID7, computed_field
|
from pydantic import model_validator, UUID7, computed_field, Field
|
||||||
|
|
||||||
from fiber_package.refs import (
|
from fiber_package.refs import (
|
||||||
CommitteeEditionRef,
|
CommitteeEditionRef,
|
||||||
@ -32,7 +32,7 @@ class CommitteeModel(FiberBaseModel):
|
|||||||
|
|
||||||
ldap_id: int | None = None
|
ldap_id: int | None = None
|
||||||
|
|
||||||
editions: CommitteeEditionRefList = CommitteeEditionRefList([])
|
editions: CommitteeEditionRefList = CommitteeEditionRefList([], "committee_edition")
|
||||||
current_edition: CommitteeEditionRef | None = None
|
current_edition: CommitteeEditionRef | None = None
|
||||||
|
|
||||||
@model_validator(mode='after')
|
@model_validator(mode='after')
|
||||||
@ -47,7 +47,7 @@ class CommitteeModel(FiberBaseModel):
|
|||||||
class CommitteeEditionModel(FiberBaseModel):
|
class CommitteeEditionModel(FiberBaseModel):
|
||||||
collection_name: Literal["committee_edition"] = "committee_edition"
|
collection_name: Literal["committee_edition"] = "committee_edition"
|
||||||
|
|
||||||
members: EntityRefList = EntityRefList([])
|
members: EntityRefList = EntityRefList([], "entity")
|
||||||
functions: dict[UUID7, str] = Field(default_factory=dict)
|
functions: dict[UUID7, str] = Field(default_factory=dict)
|
||||||
|
|
||||||
remarks: str = ""
|
remarks: str = ""
|
||||||
|
|||||||
@ -28,8 +28,8 @@ class GuildModel(FiberBaseModel):
|
|||||||
|
|
||||||
ldap_id: int | None = None
|
ldap_id: int | None = None
|
||||||
|
|
||||||
members: EntityRefList = EntityRefList([])
|
members: EntityRefList = EntityRefList([], "entity")
|
||||||
previous_members: EntityRefList = EntityRefList([])
|
previous_members: EntityRefList = EntityRefList([], "entity")
|
||||||
guild_masters: list[UUID7] = Field(default_factory=list)
|
guild_masters: list[UUID7] = Field(default_factory=list)
|
||||||
|
|
||||||
last_active: dict[UUID7, date] = Field(default_factory=dict)
|
last_active: dict[UUID7, date] = Field(default_factory=dict)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass
|
||||||
from pydantic import UUID7
|
from pydantic import UUID7
|
||||||
from typing import Literal, TypeVar
|
from typing import Literal, TypeVar
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
@ -6,7 +6,13 @@ from collections.abc import Iterator
|
|||||||
'''
|
'''
|
||||||
CollectionName provides the list of all allowed collections!
|
CollectionName provides the list of all allowed collections!
|
||||||
'''
|
'''
|
||||||
CollectionName = Literal["system", "entity", "committee", "committee_edition", "guild"]
|
CollectionName = Literal[
|
||||||
|
"association",
|
||||||
|
"entity",
|
||||||
|
"committee",
|
||||||
|
"committee_edition",
|
||||||
|
"guild"
|
||||||
|
]
|
||||||
|
|
||||||
C = TypeVar("C", bound=str)
|
C = TypeVar("C", bound=str)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user