Object does not support item assignment error

The error seems clear: model objects do not support item assignment.
MyModel.objects.latest('id')['foo'] = 'bar' will throw this same error.

It’s a little confusing that your model instance is called projectForm

To reproduce your first block of code in a loop, you need to use setattr

for k,v in session_results.iteritems():
    setattr(projectForm, k, v)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)