Skip to content

SQLAlchemy intellisense #292

Closed
Closed

Description

@redeemefy

Environment data

VS Code version: 1.18.1
Python Extension version: 0.8.0
Python Version: 3.6.3
OS and version: 10.13.1

Actual behavior

code is not prompting with intellisense for sqlalchemy.
screen shot 2017-11-25 at 2 13 26 pm

Expected behavior

Steps to reproduce:

File structure

screen shot 2017-11-25 at 2 14 57 pm

In ./__init__.py

"""Blog main module"""
from flask import Flask
from flask_sqlalchemy import SQLAlchemy


app = Flask(__name__)
app.config.from_object('settings')
db = SQLAlchemy(app)

from blog import views
from author import views

In author/models.py

from flask_blog_code import db

class Author(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    fullname = db.Column(db.string(80))
    email = db.Column(db.String(35), unique=True)
    username = db.Column(db.String(80), unique=True)
    password = db.Column(db.String(80))
    is_author = db.Column(db.Boolean)
    test = db.Co

User Settings

{
    "workbench.colorTheme": "Solarized Dark",
    "editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace",
    "editor.fontSize": 16,
    "editor.minimap.enabled": false,
    "workbench.startupEditor": "newUntitledFile",
    "python.pythonPath": "${wordspaceRoot}/venv/bin/python",
    "python.linting.flake8Path": "${workspaceRoot}/venv/bin/flake8",
    "python.linting.flake8Enabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Args": [
        "--disable=E402",
        "--max-line-length=120"
    ]
}

Logs

Output from Python output panel

Output from Console window (Help->Developer Tools menu)

Activity

  1. DonJayamanne commented on Jan 18, 2018

    @DonJayamanne

    @diazgilberto Please could you provide a sample repo for this.

  2. seven-share commented on Feb 1, 2018

    @seven-share

    i have almost the same question.
    ide show E1101:Instance of 'SQLAlchemy' has no 'Column' member
    but it works

  3. DonJayamanne commented on Feb 18, 2018

    @DonJayamanne

    seven (@seven-share) if you have a sample repo, please upload it, so I can test this.

  4. rivasd commented on Mar 2, 2018

    @rivasd

    I do not have a sample repo with non-sensitive code to upload, but I would like to confirm that I have this exact same issue and that it is definitely specific to the Flask-SQLAlchemy package

  5. brettcannon commented on Mar 7, 2018

    @brettcannon
    Member

    @pjatinsight there were some bugs around our .pylintrc detection that should be fixed in the next release.

  6. 3 remaining items

  7. brettcannon commented on Mar 12, 2018

    @brettcannon
    Member

    @pjatinsight I don't know SQLAlchemy to know well enough if that would potentially cause the issue with Python 2.7.10, but that is an old release so I would update anyway (and if you're trying to learn Python then do use Python 3 instead of Python 2).

  8. brettcannon commented on Mar 12, 2018

    @brettcannon
    Member

    But since this is a Pylint issue I'm closing as an upstream problem.

  9. anselal commented on May 8, 2018

    @anselal

    Workaround. If you have the ms-python.python installed you actually change the linter from pylint to flake8 which is a better linter and the problem is gone.

    To change the linter run the command Select Linter from the Command Palette.

    I am using flake8 on all my projects without any problems so far ;)

    Let me know if you are ok with this solution !!!

  10. KoduIsGreat commented on Jun 6, 2018

    @KoduIsGreat

    I dont understand why this is closed, This issue is about vscode intellisense, not python linting, Even with trying other linters vscode still does not appropriately display intellisense for flask-sqlalchemy,

  11. anselal commented on Jun 6, 2018

    @anselal

    Adam (@KoduIsGreat) did you try changing your linter as I mention above ?

  12. KoduIsGreat commented on Jun 6, 2018

    @KoduIsGreat

    Yes.
    "Even with trying other linters vscode still does not appropriately display intellisense for flask-sqlalchemy,"

  13. patrys commented on Jun 6, 2018

    @patrys

    Anastasios Selalmazidis (@anselal) I believe Adam (@KoduIsGreat) is talking about the original issue (ie. autocomplete not working), not the comment about pylint (ie. things being underlined incorrectly).

  14. KoduIsGreat commented on Jun 6, 2018

    @KoduIsGreat

    Patryk Zawadzki (@patrys) Yes thats correct. I think this was closed incorrectly. or should I just create a new issue.

    "SQLAlchemy intellisense" is the name of this issue, I'm confused as to how we got onto a linting discussion in the first place lol.

  15. brettcannon commented on Jun 6, 2018

    @brettcannon
    Member

    Adam (@KoduIsGreat) please create a new issue.

  16. locked as resolved and limited conversation to collaborators on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions