Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access member "objects" #14

Open
romainmartinez opened this issue Mar 30, 2021 · 2 comments
Open

Cannot access member "objects" #14

romainmartinez opened this issue Mar 30, 2021 · 2 comments

Comments

@romainmartinez
Copy link

When using pylint-mongoengine with VSCode and the pylance extension, I still get the following error:

import mongoengine


class Team(mongoengine.Document):
    name = mongoengine.StringField()
    location = mongoengine.StringField()
    shorthand = mongoengine.StringField()
    logo_src = mongoengine.URLField()
    home_primary_color = mongoengine.StringField()
    home_secondary_color = mongoengine.StringField()

    meta = {
        "db_alias": "default",
        "collection": "teams",
    }

Team.objects()
Cannot access member "objects" for type "Type[Team]"
   Member "objects" is unknown (Pylance reportGeneralTypeIssue)

Any workaround?

@RichardsonWTR
Copy link

RichardsonWTR commented Jul 2, 2022

@romainmartinez , have you tried adding load-plugins=pylint_mongoengine to your Pylint config file, or have you set the configuration shown in https://github.com/jucacrispim/pylint-mongoengine#how-to-use-in-vs-code ?

@Drahushchak
Copy link

@RichardsonWTR Unfortunately @romainmartinez is right, it's not working, I have the same issues, I set the plugin to both .pylintrc and settings.json files for VScode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants