1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on multi-value relations.

This commit is contained in:
alvinshaita
2020-08-17 06:39:10 +03:00
committed by Mariusz Felisiak
parent 36bc47069c
commit 556fa4bbba
3 changed files with 84 additions and 4 deletions

View File

@@ -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