Skip to content

Commit

Permalink
Used AUTOPOPULATE_VALUE a bit more and documented it
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Jan 16, 2025
1 parent 401a073 commit 52fbe24
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions paperqa/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,18 @@ def reduce_content(self) -> str:


class DocDetails(Doc):
model_config = ConfigDict(validate_assignment=True, extra="ignore")
model_config = ConfigDict(validate_assignment=True)

# Sentinel to auto-populate a field within model_validator
AUTOPOPULATE_VALUE: ClassVar[str] = ""

docname: str = AUTOPOPULATE_VALUE
dockey: DocKey = AUTOPOPULATE_VALUE
citation: str = ""
citation: str = AUTOPOPULATE_VALUE
key: str | None = None
bibtex: str | None = Field(
default=None, description="Autogenerated from other represented fields."
default=AUTOPOPULATE_VALUE,
description="Autogenerated from other represented fields.",
)
authors: list[str] | None = None
publication_date: datetime | None = None
Expand Down

0 comments on commit 52fbe24

Please sign in to comment.