Skip to content

Commit e36d123

Browse files
committed
chore: unused prop
1 parent 62b60e4 commit e36d123

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

templates/python/model_generic.mustache

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,11 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
8383
were set at model initialization. Other fields with value `None`
8484
are ignored.
8585
"""
86-
_dict = self.model_dump(
86+
return self.model_dump(
8787
by_alias=True,
8888
exclude_none=True,
8989
exclude_unset=True,
9090
)
91-
{{#allVars}}
92-
{{#isNullable}}
93-
# set to None if {{{name}}} (nullable) is None
94-
# and model_fields_set contains the field
95-
if self.{{name}} is None and "{{{name}}}" in self.model_fields_set:
96-
_dict['{{{baseName}}}'] = None
97-
98-
{{/isNullable}}
99-
{{/allVars}}
100-
return _dict
10191

10292
@classmethod
10393
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

0 commit comments

Comments
 (0)