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:
>>>
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
2 matches
Mail list logo