Henrik Baran
unread,Nov 12, 2017, 7:59:57 AM11/12/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi Django users,
I observed something weird while trying to update an existing database
record. I create new records by passing a dictionary as **kwargs to
.create(). This dictionary includes strings, integers and model
instances matching with my model fields. However, one model field is a
CharField that can be populated passing a model instance. This works
fine for create. But if I try to update this record passing the exactly
same dictionary as **kwargs to .update(), Django raises a TypeError
telling me that I cannot update that field because it is a CharField and
I cannot pass model instances.
... so is this a bug, because it works in .create() or must I adapt my
approach?
Thanks a lot for reply.
BR,
Henrik