We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab1c333 commit 26402e4Copy full SHA for 26402e4
mongodbforms/fields.py
@@ -89,6 +89,16 @@ def clean(self, value):
89
except (TypeError, InvalidId, self.queryset._document.DoesNotExist):
90
raise forms.ValidationError(self.error_messages['invalid_choice'] % {'value':value})
91
return obj
92
+
93
+ # Fix for Django 1.4
94
+ # TODO: Test with older django version
95
+ # from django-mongotools by wpjunior
96
+ # https://github.com/wpjunior/django-mongotools/
97
+ def __deepcopy__(self, memo):
98
+ result = super(forms.ChoiceField, self).__deepcopy__(memo)
99
+ result.queryset = result.queryset
100
+ result.empty_label = result.empty_label
101
+ return result
102
103
class DocumentMultipleChoiceField(ReferenceField):
104
"""A MultipleChoiceField whose choices are a model QuerySet."""
0 commit comments