jucacrispim / pylint-mongoengine

Pylint plugin to handle mongoengine stuff
GNU General Public License v3.0
15 stars 6 forks source link

Cannot access member "objects" #14

Open romainmartinez opened 3 years ago

romainmartinez commented 3 years ago

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 commented 2 years ago

@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 commented 1 year ago

@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.