Default severity: error · Applicability: suggestion · Category: model
Detects a CharField(...) call with no max_length= keyword. Django requires max_length on CharField; without it the model fails Django’s checks at load time — another error class you would otherwise only meet on the next runserver or makemigrations. The QuickFix (“Add max_length=255 (edit as needed)”) inserts max_length=255 as a template — 255 is a common convention, not a magic constant; size the column for the data. It is a suggestion because the right limit is yours to pick, and if the text is genuinely unbounded, TextField is the better field.
class Tag(models.Model):
name = models.CharField()
class Tag(models.Model):
name = models.CharField(max_length=255)
# orm-lens-disable-next-line DOL014
Or per-workspace in .vscode/settings.json: {"djangoOrmLens.rules": {"DOL014": "off"}}.