Coverage for rendercv/data/models/base.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-10-07 17:51 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-10-07 17:51 +0000
1"""
2The `rendercv.data.models.base` module contains the parent classes of all the data
3models in RenderCV.
4"""
6import pydantic
9class RenderCVBaseModelWithoutExtraKeys(pydantic.BaseModel):
10 """This class is the parent class of the data models that do not allow extra keys.
11 It has only one difference from the default `pydantic.BaseModel`: It raises an error
12 if an unknown key is provided in the input file.
13 """
15 model_config = pydantic.ConfigDict(extra="forbid", validate_default=True)
18class RenderCVBaseModelWithExtraKeys(pydantic.BaseModel):
19 """This class is the parent class of the data models that allow extra keys. It has
20 only one difference from the default `pydantic.BaseModel`: It allows extra keys in
21 the input file.
22 """
24 model_config = pydantic.ConfigDict(extra="allow", validate_default=True)