From 1e5e2a470768549117ac4696ce3e8b4e51d65664 Mon Sep 17 00:00:00 2001 From: André Ericson Date: Sat, 4 Oct 2014 20:47:26 -0300 Subject: Fixed #22064 -- Add check for related_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/ref/checks.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index aa3f61117c..841c8f4c48 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -117,6 +117,8 @@ Related Fields ````. * **fields.E305**: Field name ```` clashes with reverse query name for ````. +* **fields.E306**: Related name must be a valid Python identifier or end with + a ``'+'``. * **fields.E310**: None of the fields ````, ````, ... on model ```` have a ``unique=True`` constraint. * **fields.E311**: ```` must set ``unique=True`` because it is -- cgit v1.3