You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any reason why this wasn't done for all descendants of django.views.generic.View?
@rik I don't remember what was the reasoning at the time.
I think I was trying to make it work but didn't manage to convince pylint internals to suppress this error for all descendants of django.views.generic.View. However that doesn't sound very accurate (at least without experimenting).
Or it could have been that I simply didn't have any direct descendants of View in the project I was running pylint-django against.
In any case the change appears to be very small so you can experiment with it. If it works we'll happily accept a pull request, especially if you have tests in it.
NOTE: the View class can be imported in projects both as django.views.generic.View and django.views.View which I think confuses the inference machinery.
Maybe we should add a suggested value for max-parents to avoid this error in most cases. For example I am using django-import-export in my current project and I am getting R0901: Too many ancestors (10/7) (too-many-ancestors) with only one level of inheritance from from import_export.admin import ImportExportModelAdmin. I think max-parents=14 will be good enough for most cases
#254 suppressed
too-many-ancestors
forBaseDetailView
. It would be nice to suppress this message for other class-based viewsIs there any reason why this wasn't done for all descendants of
django.views.generic.View
?The text was updated successfully, but these errors were encountered: