Skip to content

Commit 8229d3d

Browse files
committed
feat: add publisher field to Config
to support the vendorization of publisher info
1 parent 2f11a9e commit 8229d3d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

dandischema/conf.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
_MODELS_MODULE_NAME = "dandischema.models"
1515
"""The full import name of the module containing the DANDI Pydantic models"""
1616

17+
PUBLISHER_PATTERN = r"RRID:\S+"
18+
"""
19+
The pattern of the ID identifying the publisher that publishes the dandisets through
20+
the DANDI instance
21+
22+
Note
23+
----
24+
This pattern currently only allows Research Resource Identifiers (RRIDs).
25+
"""
26+
1727
UNVENDORED_ID_PATTERN = r"[A-Z][-A-Z]*"
1828
UNVENDORED_DOI_PREFIX_PATTERN = r"10\.\d{4,}"
1929

@@ -125,6 +135,21 @@ class Config(BaseSettings):
125135
```
126136
"""
127137

138+
publisher: Annotated[
139+
str,
140+
StringConstraints(pattern=rf"^{PUBLISHER_PATTERN}$"),
141+
Field(
142+
validation_alias=AliasChoices("dandi_publisher", "django_dandi_publisher")
143+
),
144+
]
145+
"""
146+
ID identifying the publisher that publishes the dandisets through the DANDI instance
147+
148+
Note
149+
----
150+
This field currently only accepts Research Resource Identifiers (RRIDs).
151+
"""
152+
128153

129154
_instance_config = Config() # Initial value is set by env vars alone
130155
"""

0 commit comments

Comments
 (0)