Re: dynamic model calls

2008-01-25 Thread Russell Keith-Magee
On Jan 26, 2008 8:11 AM, Chris <[EMAIL PROTECTED]> wrote: > > Hello, > > I am seeking to do something like this: > > def dynamic_model_call(model_name): > test = model_name.objects.all() > return test > This will work fine as long as you pass an actual model into the method: >>>

dynamic model calls

2008-01-25 Thread Chris
Hello, I am seeking to do something like this: def dynamic_model_call(model_name): test = model_name.objects.all() return test I saw where I could do something like this: def dynamic_model_call(model_name): exec("test = %s.objects.all()" % model_name) return test But this