fixes for #270 and #274

This commit is contained in:
collerek
2021-07-21 14:39:23 +02:00
parent 5e0f704864
commit b423c1c56d
6 changed files with 100 additions and 19 deletions

View File

@ -121,7 +121,7 @@ class SavePrepareMixin(RelationMixin, AliasMixin):
f"model without pk set!"
)
model_dict[field] = pk_value
elif field_value: # nested dict
elif isinstance(field_value, (list, dict)) and field_value:
if isinstance(field_value, list):
model_dict[field] = [
target.get(target_pkname) for target in field_value