On 2 fév, 20:48, Tony <[email protected]> wrote:
> for example,
> I have t = 'bar' and foo = modelName.objects.get(id = 4)
> I want to do something like:
> foo.t = "new value" or foo[t] = "new value" (but those dont work).

setattr(foo, t, "new value")


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to