On Tue, Jan 11, 2011 at 7:18 AM, flavius <[email protected]> wrote: > Hi > > I am fairly new to pylons, so please explain it as clear as possible > to me. > > Currently I have a module: > > def write_greeting(context): > context.write('hello world') > > in the file > Wiki/wiki/greetings/helpers.py > > Now when I use this in my mako template > > <%namespace name="greeting" module="greetings.helpers" /> > > it says "ImportError: No module named greetings.helpers". Where should > I put that file instead, so it finds it?
I tried this in an application. The 'module' value should be the fully-qualified module name, just as you would import it in a controller. So if you put it as Wiki/wiki/greetings/helpers.py, it would be ``module="wiki.greetings.helpers``. Make sure the 'wiki' directory has an __init__.py file, as all importable packages must. A more natural place might be 'wiki/lib/greetings.py' and ``module="wiki.lib.greetings". -- Mike Orr <[email protected]> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
