[wingide-users] TurboGears relative imports

Wingware Support support at wingware.com
Tue Sep 30 08:33:35 MDT 2008

Mike Driscoll wrote:
> I am indeed using Wing 3.1.4. I apologize for not mentioning that. I 
> went to my Project Properties and in the Environment tab I changed the 
> Python Path to include my directory. Now DBSession has some code 
> completion, but Wing seems to think it's some other kind of object. It's 
> not showing the right methods at any rate. I'll submit a bug report.

The issue with this particular object is that it's really another
wrapper instance ScopedSession that has a __call__ method that will
be called for any DBSession.yyy() invocation, and that does the work
internally to call down to the real sqlalchemy DBSession object.
Wing's static analyzer cannot guess at what the __call__ does
and thus can't offer the completion values.

However, if you run to this point in Wing and use the Debug
Probe, you'll get the correct completions since then the magic
dynamic init code is run.

It looks like TG2 has completely changed how instances are started
(this is the first time I tried it).  This may have implications on
whether we're correctly finding the merged name spaces, although so
far it seems OK given the setup below:

I had to set Python Executable in Project Properties, add the files
in Wiki-20 to the project and also the file "paster" and make the
latter the main debug file.  Then I set the File Properties on
"paster" under the Debug tab so Run Arguments are "serve development.ini"
(note I removed the --reload which you won't want when debugging) and set
Initial Directory to the full path of Wiki-20.

I'll update http://wingware.com/doc/howtos/turbogears shortly; please
don't hesitate to send us additions/corrections to that.



Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list