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 (
|
||||
CommitteeEditionRef,
|
||||
@ -32,7 +32,7 @@ class CommitteeModel(FiberBaseModel):
|
||||
|
||||
ldap_id: int | None = None
|
||||
|
||||
editions: CommitteeEditionRefList = CommitteeEditionRefList([])
|
||||
editions: CommitteeEditionRefList = CommitteeEditionRefList([], "committee_edition")
|
||||
current_edition: CommitteeEditionRef | None = None
|
||||
|
||||
@model_validator(mode='after')
|
||||
@ -47,7 +47,7 @@ class CommitteeModel(FiberBaseModel):
|
||||
class CommitteeEditionModel(FiberBaseModel):
|
||||
collection_name: Literal["committee_edition"] = "committee_edition"
|
||||
|
||||
members: EntityRefList = EntityRefList([])
|
||||
members: EntityRefList = EntityRefList([], "entity")
|
||||
functions: dict[UUID7, str] = Field(default_factory=dict)
|
||||
|
||||
remarks: str = ""
|
||||
|
||||
@ -28,8 +28,8 @@ class GuildModel(FiberBaseModel):
|
||||
|
||||
ldap_id: int | None = None
|
||||
|
||||
members: EntityRefList = EntityRefList([])
|
||||
previous_members: EntityRefList = EntityRefList([])
|
||||
members: EntityRefList = EntityRefList([], "entity")
|
||||
previous_members: EntityRefList = EntityRefList([], "entity")
|
||||
guild_masters: list[UUID7] = Field(default_factory=list)
|
||||
|
||||
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 typing import Literal, TypeVar
|
||||
from collections.abc import Iterator
|
||||
@ -6,7 +6,13 @@ from collections.abc import Iterator
|
||||
'''
|
||||
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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user