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

False positive no-member errors. #192

Closed
alfonsopola opened this issue Aug 20, 2018 · 1 comment
Closed

False positive no-member errors. #192

alfonsopola opened this issue Aug 20, 2018 · 1 comment

Comments

@alfonsopola
Copy link

TODO: make sure to post the output of pip freeze
appnope==0.1.0
astroid==2.0.4
backcall==0.1.0
decorator==4.3.0
Django==2.1
django-extensions==2.1.0
django-guardian==1.4.9
djangorestframework==3.8.2
drf-nested-routers==0.90.2
dry-rest-permissions==0.1.10
ipython-genutils==0.2.0
isort==4.3.4
jedi==0.12.0
lazy-object-proxy==1.3.1
mccabe==0.6.1
parso==0.2.1
pexpect==4.6.0
pickleshare==0.7.4
pipfile==0.0.2
prompt-toolkit==1.0.15
psycopg2==2.7.5
ptyprocess==0.5.2
Pygments==2.2.0
pylint==2.1.1
pylint-django==2.0.1
pylint-plugin-utils==0.4
pytz==2018.5
simplegeneric==0.8.1
six==1.11.0
toml==0.9.4
traitlets==4.3.2
typed-ast==1.1.0
uWSGI==2.0.17.1
wcwidth==0.1.7
wrapt==1.10.11
yapf==0.22.0

  1. When I try to remove a user from a group using the following expression:
    self.user.groups.remove(self.some_group)

I get the following error:
api/models.py:451:12: E1101: Instance of 'QuerySet' has no 'remove' member (no-member) api/models.py:451:12: E1101: Instance of 'ManyToManyField' has no 'remove' member (no-member)

  1. When I try to change a ManyToManyField using .set like this:
    self.some_many_to_many_field.set(userlist)

I get the following error:
api/models.py:525:8: E1101: Instance of 'QuerySet' has no 'set' member; maybe 'get'? (no-member) api/models.py:525:8: E1101: Instance of 'ManyToManyField' has no 'set' member (no-member)

@atodorov
Copy link
Contributor

Somewhat similar to #188 but not exactly the same. Root cause is the automatic creation of related attributes which pylint-django doesn't know about.

pchiquet referenced this issue in pchiquet/pylint-django Jun 25, 2019
"remove" and "set" methods were missing on RelatedManager
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

2 participants