We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
field-choices-constraint
1 parent 8acb037 commit b671038Copy full SHA for b671038
src/extra_checks/checks/model_field_checks.py
@@ -308,6 +308,6 @@ def apply(
308
check = f'models.Q({in_name}=[{", ".join([self._repr_choice(c) for c in field_choices])}])'
309
yield self.message(
310
"Field with choices must have companion CheckConstraint to enforce choices on database level.",
311
- hint=f'Add to Meta.constraints: `models.CheckConstraint(name="%(app_label)s_%(class)s_{field.name}_valid", check={check})`',
+ hint=f'Add to Meta.constraints: `models.CheckConstraint(name="%(app_label)s_%(class)s_{field.name}_valid", condition={check})`',
312
obj=field,
313
)
0 commit comments