From 556fa4bbba5ba86bc1646a86fb11ab55405d4aa4 Mon Sep 17 00:00:00 2001 From: alvinshaita Date: Mon, 17 Aug 2020 06:39:10 +0300 Subject: Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on multi-value relations. --- tests/model_forms/models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/model_forms/models.py') diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py index 1a2102f898..4e9ed2b1e4 100644 --- a/tests/model_forms/models.py +++ b/tests/model_forms/models.py @@ -411,9 +411,14 @@ class StumpJoke(models.Model): Character, models.CASCADE, limit_choices_to=today_callable_dict, - related_name="+", + related_name='jokes', ) - has_fooled_today = models.ManyToManyField(Character, limit_choices_to=today_callable_q, related_name="+") + has_fooled_today = models.ManyToManyField( + Character, + limit_choices_to=today_callable_q, + related_name='jokes_today', + ) + funny = models.BooleanField(default=False) # Model for #13776 -- cgit v1.3