We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4758fb commit eabb48bCopy full SHA for eabb48b
osc/util/models.py
@@ -312,10 +312,7 @@ def get(self, obj):
312
# if this is a model field, convert dict to a model instance
313
if self.is_model and isinstance(default, dict):
314
cls = self.origin_type
315
- new_value = cls() # pylint: disable=not-callable
316
- for k, v in default.items():
317
- setattr(new_value, k, v)
318
- default = new_value
+ default = cls(**default)
319
320
obj._defaults[self.name] = default
321
return default
0 commit comments