Undefined variable from import: bottag

2011-03-17
2013-03-15
  • First of all I want to mention that I just started to look at PyDev and I am really impressed with it.

    The only only issue so far is this, in a very small file I have some 20+ errors.

    bottag is a column in a SQLAlchemy declarative table definition for this particular application.  All the definitions are in 'module.py' which is within the source directory of that project.

    This seems to come up pretty often, but looking at the FAQ, through this list and googled but I did not find a solution to this type of problem.

    If there is a solution maybe add it to the FAQ.

    Werner

     
  • There are of course limitations we need to live with when using a dynamically typed language.

    But maybe some improvements are still possible, or resorting to tricks like mentioned here:
    http://www.mail-archive.com/pydev-users@lists.sourceforge.net/msg04264.html

    Since SQLAlchemy is widely used, maybe it can get some special support like Django?

     
  • Thanks for the link to your work around, helped me got rid of a few other warnings.

    However I hope there will be a "nicer" way to deal with all the column definitions.  Maybe some script one has to run and feed it the module.py and it generates whatever PyDev needs to be "more" happy.

    Werner

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2011-03-20

    Can you create a bug and attach a sample project of what you're attempting and how PyDev could know about it (in Django there are some specially crafted constructs that PyDev gets, but this is usually something that has to be done for each specific situation, as there are usually odd constructs and a specific heuristic has to be added to the PyDev static analyzer).

    Note that there is an option where you can have pre-defined tokens, but they should not conflict with the sources you have, only with the sources in your interpreter (see: http://pydev.org/manual_101_interpreter.html#id2 )

    Cheers,

    Fabio

     
  • Christoph (cito),

    Any chance you could do the bug for this, I think you would much better explain the issues then I could possibly do.

    Werner

     
  • I created tracker item 3231492.

    I would still like Christoph or someone else who can better explain what the issues are to provide better support for sqlalchemy in PyDev.

    Werner

     
  • Not sure if this the same issue as Werner's, but I have added an example at https://sourceforge.net/tracker/?func=detail&aid=3231492&group_id=85796&atid=577332 showing how SQLAlchemy is used by web frameworks like TurboGears. The session methods and the query property and its method are not recognized and marked as errors. Could this be solved with .pypredef files or some other clever hack?