On Thu, Mar 26, 2009 at 4:21 PM, Thomas Guettler <[email protected]> wrote:
> # views.py (untested)
> def wrapper(request, name):
> module=__import__("myproject.database.reports.%s" % name, globals(),
> locals(), [name])
> method=getattr(module, name)
> return method(request)
>
this works:
def wrapper(request, name):
module=__import__("legacoopfc.database.reports", globals(), locals(),
[name])
method=getattr(module, name)
return method(request)
it's because all my views are on the same module.
Is it possible to get a list of function names inside a module?
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net
SOASI Soc.Coop. - www.soasi.com
Sviluppo Software e Sistemi Open Source
Sede: Via Poggiali 2/bis, 47100 Forlì (FC)
Tel.: +39 0543 798985 - Fax: +39 0543 579928
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---