-
Notifications
You must be signed in to change notification settings - Fork 116
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
Incorrectly identify queryset as not iterable when model manager is a subclass #117
Comments
suspect it's not picking up the class properly if you use the shortcut. As a workaround, I've changed my managers to be defined like so: from django.db.models import manager
class MyModelManager(manager.Manager):
... will want to revert this change once the regression is fixed. |
FWIW, the manager is defined like this:
https://github.com/jazzband/django-model-utils/blob/master/model_utils/managers.py#L262 |
@SpoonMeiser can you post a reproducer which includes all the necessary imports and empty class definitions (e.g. using pass) so I can try and reproduce. @cybojenix I think you are right but without the full reproducer I can't really do anything. |
Ok, with python 2.7
Test file:
Linting with pylint-django:
The traceback I'd not seen before. |
We've been getting this error since updating to pylint 1.8.2. Suggest replicating with 1.8.1 until the above error is resolved. |
The NamesConsumer error is #120 and was fixed in version 0.9.0 |
Why is this labelled as an enhancement? Surely it's a bug/regression? |
I'm also seeing this issue..
|
In Read the Docs something similar to what @hermansc described happened (with pylint=1.8.3 and pylint-django==0.9.4). The problem was with |
I still run into this issue with |
as far as i see, the issue isn't resolved. see this:
using |
@nirsalon this is a new issue but related. file it separately. |
FWIW, I was getting
to:
Did the trick. I am currently using |
Since upgrading to version 0.8.0 (and pylint 1.8) we're incorrectly getting an error that a queryset is not iterable:
MyModel
in this case is a subclass of a model that hasobjects
set to a subclass of of the usual manager (in particular, it usesmodel_utils.managers.InheritanceManager
)Similar uses where the standard manager is used does not cause this error, and we did not get this error with previous versions of pylint and pylint-django.
The text was updated successfully, but these errors were encountered: