def add_update_values(self, values):
        values_seq = []
        for name, val in values.iteritems():
            field, model, direct, m2m = self.model._meta.get_field_by_name(name)
            if not direct or m2m:
                raise FieldError('Cannot update model field %r (only non-relations and foreign keys permitted).' % field)
            if model:
                self.add_related_update(model, field, val)
                continue
            values_seq.append((field, model, val))
        return self.add_update_fields(values_seq)
Convert a dictionary of field name to value mappings into an update
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/db/models/sql/subqueries.py/UpdateQuery.add_update_values