HSGPBase.model_construct#
- classmethod HSGPBase.model_construct(_fields_set=None, **values)#
Creates a new instance of the
Modelclass with validated data.Creates a new model setting
__dict__and__pydantic_fields_set__from trusted or pre-validated data. Default values are respected, but no other validation is performed.- !!! note
model_construct()generally respects themodel_config.extrasetting on the provided model. That is, ifmodel_config.extra == 'allow', then all extra passed values are added to the model instance’s__dict__and__pydantic_extra__fields. Ifmodel_config.extra == 'ignore'(the default), then all extra passed values are ignored. Because no validation is performed with a call tomodel_construct(), havingmodel_config.extra == 'forbid'does not result in an error if extra values are passed, but they will be ignored.- Args:
- _fields_set: A set of field names that were originally explicitly set during instantiation. If provided,
this is directly used for the [
model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from thevaluesargument will be used.
values: Trusted or pre-validated data dictionary.
- Returns:
A new instance of the
Modelclass with validated data.