Pylint can't find SQLAlchemy query member

前端 未结 13 1425
予麋鹿
予麋鹿 2021-01-30 08:25

I have a Flask (v0.10.1) application using Flask-SQLAlchemy (v2.0) and I\'m trying to configure Pylint to check it. Running with Python 3.4.2.

First error was:



        
13条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 08:56

    I meet the same issue when using flask_sqlalchemy. my solution is:

    pylint --generate-rcfile>~/.config/pylintrc
    

    and then find the

    ignored-modules
    

    line, rewrite it to:

    ignored-modules=flask_sqlalchemy
    

    all E1101 errors are gone.

    Remeber to read the comment:

    # List of module names for which member attributes should not be checked
    # (useful for modules/projects where namespaces are manipulated during runtime
    # and thus existing member attributes cannot be deduced by static analysis. It
    # supports qualified module names, as well as Unix pattern matching.
    

提交回复
热议问题