We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class Product(models.Model): test = models.CharField(null=True, blank=True, max_length=255)
is correct
DJ001 Avoid using null=True on string-based fields such as CharField
null=True
CharField
but
class Product(models.Model): test = models.CharField(null=True, blank=True, max_length=255, unique=True)
All checks passed!
gives no warning
ruff version 0.7.0
The text was updated successfully, but these errors were encountered:
Hmm looks like this is expected behaviour
ruff/crates/ruff_linter/src/rules/flake8_django/rules/nullable_model_string_field.rs
Line 105 in 4d10951
Sorry, something went wrong.
See https://docs.djangoproject.com/en/5.1/ref/models/fields/#null for the rationale. This is indeed expected behavior
No branches or pull requests
is correct
but
gives no warning
ruff version 0.7.0
The text was updated successfully, but these errors were encountered: