mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #22064 -- Add check for related_name
Validates that related_name is a valid Python id or ends with a '+' and it's not a keyword. Without a check it passed silently leading to unpredictable problems. Thanks Konrad Świat for the initial work.
This commit is contained in:
parent
8c581ff394
commit
1e5e2a4707
3 changed files with 90 additions and 0 deletions
|
@ -117,6 +117,8 @@ Related Fields
|
|||
``<field name>``.
|
||||
* **fields.E305**: Field name ``<field name>`` clashes with reverse query name
|
||||
for ``<field name>``.
|
||||
* **fields.E306**: Related name must be a valid Python identifier or end with
|
||||
a ``'+'``.
|
||||
* **fields.E310**: None of the fields ``<field1>``, ``<field2>``, ... on model
|
||||
``<model>`` have a ``unique=True`` constraint.
|
||||
* **fields.E311**: ``<model>`` must set ``unique=True`` because it is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue