The symbolic link approach seems to me to be more interesting than
modifying web2py.py, but i do not see why the sys.path.append thing at
application code is not recomended. I'll have to search on that topic.

Thanks again for the support

On Dec 2, 2:04 am, Massimo Di Pierro <[email protected]>
wrote:
> you can create symbolic link to the web2py/site-packages folder or you
> can add a sys.path.append to web2py.py
>
> On Dec 1, 9:14 pm, Alan Etkin <[email protected]> wrote:
>
> > The required modules are stored outside the web2py folder because they
> > are shared by a non web2py app. So i cannot import them with that
> > method. I know i could just copy them into the app's modules folder
> > and that would be it, But i do not want to duplicate files.
>
> > On Dec 1, 11:19 am, Anthony <[email protected]> wrote:
>
> > > On Thursday, December 1, 2011 8:58:03 AM UTC-5, Alan Etkin wrote:
>
> > > > >Instead making local_import("model") for a model stored at myweb2pyapp/
> > > > >models/model.py, i need to make the same statement for a model stored
> > > > >at ~/another/path/module.py
>
> > > > I meant import modules, sorry for the mistake.
>
> > > > So to import a module from another path i could do:
>
> > > > from gluon.custom_import import track_changes
> > > > track_changes(True)
> > > > sys.path.append("another/path")
>
> > > I don't think manipulating sys.path from your app code is recommended. Is
> > > the module in the modules folder of another app? If so, just do:
>
> > > from applications.appname.modules import mymodule
>
> > > Anthony

Reply via email to