-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rule N806 and Django #7675
Comments
I think this could a setting for N806 that allows |
I'm open to supporting this, although I think it should just be enabled and not behind a setting. I think we need to support both |
Also |
I suppose we could extend this to allow any |
After going through and renaming our violations, I don't feel as strongly that the rule should change. Perhaps the restriction should only be relaxed when the right-hand side is a variable? I know this would still cause my third screenshot to be broken, but I think there's more value in ensuring you didn't typo your model name than there is in allowing this one-off rare case. |
That seems reasonable to me. I added it in: #9065. |
In django, you can access a model by importing it or by getting it from the registry (i.e. calling apps.get_model). The convention is to name the variable in title case to match the model's name.
Example from the docs: https://docs.djangoproject.com/en/4.2/ref/applications/#django.apps.AppConfig.ready
However, this clashes with rule N806.
Is there a way to make this work?
The text was updated successfully, but these errors were encountered: