33from pydantic import BaseModel , ConfigDict , field_validator , model_validator
44from typing import List
55from .utils import Validation
6+ from .contribution import Contribution
67
78class Organization (BaseModel ):
89 model_config = ConfigDict (validate_assignment = True )
@@ -14,27 +15,6 @@ class Type(Enum):
1415 SPONSOR = "SPONSOR"
1516 PAMS_TD_INST = "PAMS_TD_INST"
1617
17- class Contribution (Enum ):
18- DataCollector = "DataCollector"
19- DataCurator = "DataCurator"
20- DataManager = "DataManager"
21- Distributor = "Distributor"
22- Editor = "Editor"
23- HostingInstitution = "HostingInstitution"
24- Producer = "Producer"
25- ProjectLeader = "ProjectLeader"
26- ProjectManager = "ProjectManager"
27- ProjectMember = "ProjectMember"
28- RegistrationAgency = "RegistrationAgency"
29- RegistrationAuthority = "RegistrationAuthority"
30- Researcher = "Researcher"
31- ResearchGroup = "ResearchGroup"
32- RightsHolder = "RightsHolder"
33- Sponsor = "Sponsor"
34- Supervisor = "Supervisor"
35- WorkPackageLeader = "WorkPackageLeader"
36- Other = "Other"
37-
3818 type :str
3919 name :str = None
4020 contributor_type : str = None
@@ -57,7 +37,7 @@ def type_must_be_valid(cls, value: str) -> str:
5737 @field_validator ("contributor_type" )
5838 @classmethod
5939 def contributor_must_be_valid (cls , value : str ) -> str :
60- if value not in [type .value for type in cls . Contribution ]:
40+ if value not in [type .value for type in Contribution ]:
6141 raise ValueError ("Unknown contribution type {}." .format (value ))
6242 return value
6343
0 commit comments