Skip to content

rendercv_model

RenderCVModel

Bases: BaseModelWithExtraKeys

cv = pydantic.Field(default_factory=Cv, title='CV', description='The content of the CV.') class-attribute instance-attribute

design = pydantic.Field(default_factory=ClassicTheme, title='Design', description='The design information of the CV. The default is the `classic` theme.') class-attribute instance-attribute

locale = pydantic.Field(default_factory=EnglishLocale, title='Locale Catalog', description='The locale catalog of the CV to allow the support of multiple languages.') class-attribute instance-attribute

model_config = pydantic.ConfigDict(json_schema_extra={'required': []}) class-attribute instance-attribute

settings = pydantic.Field(default_factory=Settings, title='RenderCV Settings', description='The settings of the RenderCV.') class-attribute instance-attribute

set_input_file_path(info)

Store input file path in private attribute for path resolution.

Why

Photo paths and other relative references need input file location for resolution. Private attribute stores this after validation for downstream processing.

Parameters:

  • info (ValidationInfo) –

    Validation context containing input file path.

Returns:

Source code in src/rendercv/schema/models/rendercv_model.py
@pydantic.model_validator(mode="after")
def set_input_file_path(self, info: pydantic.ValidationInfo) -> "RenderCVModel":
    """Store input file path in private attribute for path resolution.

    Why:
        Photo paths and other relative references need input file location
        for resolution. Private attribute stores this after validation for
        downstream processing.

    Args:
        info: Validation context containing input file path.

    Returns:
        Model instance with _input_file_path set.
    """
    self._input_file_path = get_input_file_path(info)
    return self