1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #33084 -- Removed incorrect system check for ManyToManyField with limit_choices_to.

This commit is contained in:
Hasan Ramezani
2021-09-08 13:57:49 +02:00
committed by Mariusz Felisiak
parent 46c8df640c
commit 0a28b42b15
6 changed files with 34 additions and 45 deletions

View File

@@ -480,3 +480,20 @@ class NullableUniqueCharFieldModel(models.Model):
email = models.EmailField(blank=True, null=True)
slug = models.SlugField(blank=True, null=True)
url = models.URLField(blank=True, null=True)
class Number(models.Model):
value = models.IntegerField()
class NumbersToDice(models.Model):
number = models.ForeignKey('Number', on_delete=models.CASCADE)
die = models.ForeignKey('Dice', on_delete=models.CASCADE)
class Dice(models.Model):
numbers = models.ManyToManyField(
Number,
through=NumbersToDice,
limit_choices_to=models.Q(value__gte=1),
)