Re: How does django convert string to modules

2010-09-11 Thread bruno desthuilliers
On 11 sep, 02:37, Bachir wrote: > What if was gibing a string like this: 'math.ceil', and i had to import the > function(not the module) dynamically(from the string), how can i do that? > import_module is for importing... modules, not functions. Why don't you just read the code snippet I posted ?

Re: How does django convert string to modules

2010-09-10 Thread Bachir
What if was gibing a string like this: 'math.ceil', and i had to import the function(not the module) dynamically(from the string), how can i do that? import_module is for importing... modules, not functions. 2010/9/10 Bachir > thanks, éthat's really an awesome explanation. thanks > > 2010/9/10 T

Re: How does django convert string to modules

2010-09-10 Thread Bachir
thanks, éthat's really an awesome explanation. thanks 2010/9/10 Tom Evans > On Fri, Sep 10, 2010 at 1:05 AM, Bachir wrote: > > The problem is not the lack of information, the real problem is that i > don't > > know what to search for . > > > > 2010/9/9 bruno desthuilliers > >> > >> > >> On 9 s

Re: How does django convert string to modules

2010-09-10 Thread Tom Evans
On Fri, Sep 10, 2010 at 1:05 AM, Bachir wrote: > The problem is not the lack of information, the real problem is that i don't > know what to search for . > > 2010/9/9 bruno desthuilliers >> >> >> On 9 sep, 03:46, maroxe wrote: >> > Hi, I am trying to understand an other magic thing about django:

Re: How does django convert string to modules

2010-09-09 Thread Bachir
The problem is not the lack of information, the real problem is that i don't know what to search for . 2010/9/9 bruno desthuilliers > > > On 9 sep, 03:46, maroxe wrote: > > Hi, I am trying to understand an other magic thing about django: it > > can convert strings to modules. In settings.py, IN

Re: How does django convert string to modules

2010-09-09 Thread bruno desthuilliers
On 9 sep, 03:46, maroxe wrote: > Hi, I am trying to understand an other magic thing about django: it > can convert strings to modules. In settings.py, INSTALLED_APPS is > declared like that: > > INSTALLED_APPS = ( >     'django.contrib.auth', >     'django.contrib.contenttypes', >     'django.co

Re: How does django convert string to modules

2010-09-08 Thread Kenneth Gonsalves
On Wed, 2010-09-08 at 18:46 -0700, maroxe wrote: > I want to use it later like this: RESOURCE_RENDERER'video' I cannot > assign directly the function name(eg video_player) because it lives in > a module that needs settings.py > > Any idea? check out getattr() -- regards Kenneth Gonsalves -- Y