vdoc.models package
Subpackages
Submodules
vdoc.models.project module
Contains all project model definitions.
- class vdoc.models.project.Project(**data)
Bases:
BaseModel
Pydantic model for a project.
- property category_id: int | None
Returns the category ID of the project if configured, otherwise None.
- Returns:
The optional project category ID.
- Return type:
int | None
- property display_name: str
Returns the display name of the project if configured, otherwise the project name.
- Returns:
The project display name.
- Return type:
str
- classmethod get_version_and_docs_path(name, version)
Returns the validated version and the path containing the documentation.
- Parameters:
name (
str
) – The project name.version (
str
) – The project version. Iflatest
, the path to the newest version will be returned.
- Raises:
ProjectNotFound – If the project doesn’t exist.
InvalidVersion – If the version is of an invalid format.
ProjectVersionNotFound – If the project doesn’t have the requested version.
- Return type:
tuple
[str
,Path
]- Returns:
The validated version and the path containing the documentation.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_project_exists(value)
Validates the project’s existence.
- Parameters:
value (
str
) – The project name.- Raises:
ProjectNotFound – If the project doesn’t exist.
- Return type:
str
- Returns:
The validated project name.
- property versions: Dict[Version, str]
Returns a list of all available project versions.
- Raises:
ProjectNotFound – If the project doesn’t exist.
- Returns:
A list of all versions of the project.
vdoc.models.project_category module
Contains the project category model.
Module contents
Contains all models.