2009/7/23 Alex Fanjul <alex.fan...@gmail.com>: > NameError: global name 'A' is not defined > Do I have to import gluon in the module? how? > My view code is like this: > {{from helpers import pagenav as pagenav}}
I didn't write the helpers module & I don't use it in the same way that post does. (I define a variant thereof in my model rather than a module, although the module would be more efficient since it shouldn't ever be called now unless ppl have javascript disabled) If modules call gluon functions, then yes, they need to be imported within that module. This should fix that error, although there may be other parts you need to import as well: from gluon.http import * > Another question: could you give me an example to call shn_rest_controller?? Very simple ;) http://trac.sahanapy.org/browser/controllers/cr.py def shelter(): return shn_rest_controller(module, 'shelter') F --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---