Re: Dynamically load objects

2007-11-17 Thread Grupo Django
On 17 nov, 01:28, "Ramiro Morales" <[EMAIL PROTECTED]> wrote: > On Nov 16, 2007 8:18 PM, Grupo Django <[EMAIL PROTECTED]> wrote: > > > > > Thanks a lot! get _model works. > > Only one thing, I've been reading the code in te file django/db/models/ > > loading.py and I don't understand how it work

Re: Dynamically load objects

2007-11-16 Thread Ramiro Morales
On Nov 16, 2007 8:18 PM, Grupo Django <[EMAIL PROTECTED]> wrote: > > Thanks a lot! get _model works. > Only one thing, I've been reading the code in te file django/db/models/ > loading.py and I don't understand how it works, and now I need to know > or I won't sleep :-) > > What should I do to ref

Re: Dynamically load objects

2007-11-16 Thread Grupo Django
Thanks a lot! get _model works. Only one thing, I've been reading the code in te file django/db/models/ loading.py and I don't understand how it works, and now I need to know or I won't sleep :-) What should I do to reference stuff? app = __import__('app_name',{},{},['models']) mods = getattr(ap

Re: Dynamically load objects

2007-11-16 Thread Doug B
I'd love to know if there is a better method, but this is the best I could come up with... pretty much the same thing you are doing, but forcing the view functions to call 'import_feed' which can only load a restricted set of modules. AVAILABLE_FEEDS = {'columbia':'columbia.search','glvar':'glvar

Dynamically load objects

2007-11-16 Thread Grupo Django
Hello, In a view, I have: from app.models import something def my_view( request, mod_name ): m = __import__('app.models',globals(),locals(),['something'] ) Now I'd like to do: items = m.filter( ... ) for item in items: ... What I need is to load a model dynamically and then use