Referencing Model Instance Fields Dynamically

To update an prior undeclared model instance using a fields dictionary settattribute can be used::

for k,v in fields.iteritmes():
   setattr(instance, k, v

In the case of ManyToMany relationship attributes its counterpart gettattribute comes in handy::

getattr(instance, k).add(relatedObject)
Edit tutorial

Comment on This Data Unit