If I do "from gluon import *" then it does not find request, response,
session.

If I do "from gluon import request,response,session" then it works!

I guess this is an aptana bug.

On Feb 6, 5:44 pm, Anthony <abasta...@gmail.com> wrote:
> I'm not sure about that problem, but note that trunk now includes the
> following in __init__.py:
>
> if 0:
>     from globals import Request, Response, Session
>     from cache import Cache
>     from languages import translator
>     request = Request()
>     response = Response()
>     session = Session()
>     cache = Cache(request)
>     T = translator(request)
> So, you shouldn't have to include the T, session, request, response part of
> your IDE.py, and you'll now get autocomplete for those objects.
>
> Anthony
>
>
>
>
>
>
>
> On Monday, February 6, 2012 12:30:06 PM UTC-5, apple wrote:
>
> > I am using aptana. I have included the modules and models directories
> > in the pythonpath; and at the top of each python file I have "from ide
> > import *".  This refers to the file below and is supposed to to stop
> > it marking references to web2py variables as errors and to enable
> > autocomplete.
>
> > This seems to work but intermittently it forgets where to find the IDE
> > file then later it remembers again. Can anyone tell me why this
> > happens? Is there something else I need to do to make sure aptana
> > knows about web2py and does not keep forgetting?
>
> > MODULES/IDE.PY contains:
>
> > """ defines the web2py environment for the ide """
> > if 0:
> >     # web2py globals
> >     from gluon import *
> >     T, session,request,response=None
>
> >     # application models
> >     from db import *
> >     from dbinit import *
> >     from dbtables import *
> >     from menu import *
> >     from menua import *

Reply via email to