1
0
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:
Stephen Burrows
2012-10-03 19:50:12 +03:00
committed by Anssi Kääriäinen
parent d25a599dca
commit 218abcc9e5
6 changed files with 40 additions and 7 deletions

View File

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