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

Pylint Error displayed when have objects = models.Manager() in Model #144

Closed
yybot1 opened this issue Mar 26, 2018 · 1 comment
Closed

Comments

@yybot1
Copy link

yybot1 commented Mar 26, 2018

models.py

class ABC(models.Model):
    objects = models.Manager() # default manager

views.py

# E1136:Value 'ABC.objects.all()' is unsubscriptable
record = ABC.objects.all()[0]

Visual Studio Code 1.21.1
Windows 10
Python 3.6.4
pip list
astroid (1.6.2)
attrs (17.4.0)
colorama (0.3.9)
Django (2.0.3)
djangorestframework (3.7.7)
isort (4.3.4)
lazy-object-proxy (1.3.1)
mccabe (0.6.1)
more-itertools (4.1.0)
pip (9.0.3)
pluggy (0.6.0)
py (1.5.3)
pylint (1.8.3)
pylint-django (0.9.4)
pylint-plugin-utils (0.2.6)
pytest (3.5.0)
pytest-django (3.1.2)
pytz (2018.3)
rope (0.10.7)
selenium (3.11.0)
setuptools (28.8.0)
six (1.11.0)
wrapt (1.10.11)

@stugots
Copy link

stugots commented Mar 30, 2018

I'm also seeing this.

atodorov added a commit that referenced this issue Apr 5, 2018
atodorov added a commit that referenced this issue Apr 5, 2018
the way we do this is by modifying our transformations to return
an empty list instead of None.
atodorov added a commit that referenced this issue Apr 5, 2018
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