Re: variable column name

2011-02-02 Thread bruno desthuilliers
On 2 fév, 20:48, Tony 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

variable column name

2011-02-02 Thread Tony
If I return a string variable from a template to a view function, and the string variable is the name of a model (so I dont know which one it is) in a known class for a known object in the database, is there anyway I can change the data for that column without doing a bunch of if statements trying