To get eclipse/PyDev to autocomplete web2py code, after some quick trial 
and error here is what worked for me:

Assuming:
the top level eclipse project dir is web2py
your_app is the name of your application inside the web2py/applications 
folder:

In __init__.py of your_app folder:

if 0:
    from gluon import *
    from gluon.languages import translator as T

In your controllers, say for e.g. in appadmin.py, add this line:

from applications.your_app import *

Now PyDev will recognize and complete things like URL etc. and T. You can 
add more to your_app/__init__.py to introduce more recognition. There may 
be better more standard ways to do this, I'm not a software engineer, still 
learning the tricks of the trade!

Thanks!

On Tuesday, April 3, 2012 7:54:06 PM UTC-7, Rod Watkins wrote:
>
> I know this has been asked before. I don't mean to be an annoyance. I've 
> done the searches are read numerous posts about how to handle this. But the 
> advice conflicts and I've yet to actually fix the problem. 
>
> What is the best way to handle imports for eclipse to get autocomplete to 
> work properly (as well as rid eclipse of all the incorrect error messages?
>
> I rather like having autocomplete functioning since, as a beginner, it 
> helps me discover functionality that I might otherwise miss (besides saving 
> some typing).
>
> Please accept my thanks in advance for any help on this.
>
> Cordially,
> Rod Watkins
>

-- 



Reply via email to