adds some tests for to_model
This commit is contained in:
parent
f61fcb1261
commit
6817babf3c
2 changed files with 69 additions and 22 deletions
|
@ -104,14 +104,12 @@ class ActivityObject:
|
|||
one_to_many_fields[field.name] = value
|
||||
elif isinstance(model_field, ImageFileDescriptor):
|
||||
# image fields need custom handling
|
||||
print(model_field, field.name, value)
|
||||
image_fields[field.name] = value
|
||||
else:
|
||||
if value == MISSING:
|
||||
value = None
|
||||
mapped_fields[field.name] = value
|
||||
|
||||
|
||||
if instance:
|
||||
# updating an existing model instance
|
||||
for k, v in mapped_fields.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue