mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #14567 -- Made ModelMultipleChoiceField return EmptyQuerySet as empty value
This commit is contained in:
committed by
Anssi Kääriäinen
parent
d25a599dca
commit
218abcc9e5
@@ -63,6 +63,12 @@ class ChoiceFieldModel(models.Model):
|
||||
multi_choice_int = models.ManyToManyField(ChoiceOptionModel, blank=False, related_name='multi_choice_int',
|
||||
default=lambda: [1])
|
||||
|
||||
class OptionalMultiChoiceModel(models.Model):
|
||||
multi_choice = models.ManyToManyField(ChoiceOptionModel, blank=False, related_name='not_relevant',
|
||||
default=lambda: ChoiceOptionModel.objects.filter(name='default'))
|
||||
multi_choice_optional = models.ManyToManyField(ChoiceOptionModel, blank=True, null=True,
|
||||
related_name='not_relevant2')
|
||||
|
||||
|
||||
class FileModel(models.Model):
|
||||
file = models.FileField(storage=temp_storage, upload_to='tests')
|
||||
|
||||
Reference in New Issue
Block a user