pylint-django
pylint-django copied to clipboard
Pylint plugin for improving code analysis for when using Django
A user just [asked a question](https://forum.djangoproject.com/t/best-practice-and-documentation-from-django-contrib-auth-models-import-user-pylint-and-errors/12492) on the Django forum about why pylint says to use `get_user_model()`. Here's my response: > Django does say to use `get_user_model()`… only when building...
Request for a new pylint-django checker to flag cases when I forgot to ad `.objects` to my ORM calls. I often write ``` models.MyModel.get(id=1) ``` instead of ``` models.MyModel.objects.get(id=1) ```...
I have the following model: `class ModelBook(index.Indexed, AbstractSEOFields):` The AbstractSEOFields class extends from models.Model. However, I got the following pylint errors: app_name/models.py:406:24: E1101: Instance of 'ForeignKey' has no 'make' member...
Why: - The fields label and value are not marked as missing This change addresses the need by: - Adding a test to ensure that pylint does not mark these...
When an `__init__.py` file is missing in a module, pylint will crash. The command I used was: ``` pylint --rcfile=pylintrc backend/core/serializers/some_serializer.py ``` which caused pylint to crash with the error:...
https://github.com/PyCQA/pylint-django/pull/254 suppressed `too-many-ancestors` for `BaseDetailView`. It would be nice to suppress this message for other class-based views Is there any reason why this wasn't done for all descendants of `django.views.generic.View`?
I'm getting the following error with code that raises a 404 exception within an exception handler: > raise-missing-from: Consider explicitly re-raising using the 'from' keyword For instance, in this simplified...
I am running into several issues... But here's my structure: > > ├── __pycache__ > ├── django_jinja > │ ├── __pycache__ > │ ├── builtins > │ ├── contrib >...
With the following code: ``` from django.db import models class ExtraFileField(models.FileField): pass class Foo(models.Model): document = ExtraFileField(verbose_name='whatever') ``` I get warnings: > test.py:7:15: E1123: Unexpected keyword argument 'verbose_name' in constructor...
I'm getting the following error when I run `pylint` on my project using `pylint-django==2.4.2`: ```bash > poetry run pylint --django-settings-module=myapp.settings myapp Traceback (most recent call last): File "/home/sylvain/LNS/mylns-api/.venv/lib/python3.7/site-packages/pylint_django/checkers/foreign_key_strings.py", line 90,...