On Feb 26, 2010, at 3:46 AM, Tiago Almeida wrote: > How do you usually import a module from a module. I've tried using > local_import but I had problems (don't remember details) so I solved the > problem by hardcoding the path like 'applications.<appname>/modules/...' but > don't like it. > Can local_import do this and I used it incorrectly?
local_import isn't in the environment of a module, so you can't use it. You also don't have request, so you can't get your appname from there, either. If it's not a problem to add request.folder to sys.path, that would probably work (though you might want to do it a little more carefully than I did, and check that it's not already in the path). -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@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.