models and controllers are not modules.
models and controllers can import modules using "import <module>" if
<module> is in sys.path and using "local_import(<module>)" if <module>
is not in sys.path but is in /applications/app/modules.
modules are - of course - modules so thy can import other modules
using "import <module>". They should not and cannot use "local_import"
because that's only for models and controllers.
Massimo
On Dec 9, 8:47 am, John-Kim Murphy <
left...@gmail.com> wrote:
> I am trying to import a module 'pychimp' from another module 'inbite'
> using local_import(). Both modules are in my modules directory. When I
> nest a local_import() inside another local_import() I get an error:
>
>
c...@inbite.py:
> local_import('pychimp', reload=True)
>
> >>> inbite = local_import('inbite', reload=True)
>
> Traceback (most recent call last):
> File "<console>", line 1, in <module>
> File "gluon/compileapp.py", line 241, in <lambda>
> File "gluon/compileapp.py", line 176, in local_import_aux
> File "applications\inbite\modules\inbite.py", line 3, in <module>
> NameError: name 'local_import' is not defined
>
> So I try importing the module that has local_import:
>
c...@inbite.py: