Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

newforms-admin: Fixed #4046 - ForeignKey's formfield does not respect…

… limit_choices_to. Thanks ubernostrum, programmerq

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0ad37188cf999ff0db1b0b09a82eaf86e7e30c9b 1 parent 420f19a
Luke Plant spookylukey authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/fields/
4 django/db/models/fields/
@@ -672,7 +672,7 @@ def contribute_to_related_class(self, cls, related):
setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))
def formfield(self, **kwargs):
- defaults = {'form_class': forms.ModelChoiceField, 'queryset':}
+ defaults = {'form_class': forms.ModelChoiceField, 'queryset':}
return super(ForeignKey, self).formfield(**defaults)
@@ -810,7 +810,7 @@ def save_form_data(self, instance, data):
setattr(instance, self.attname, data)
def formfield(self, **kwargs):
- defaults = {'form_class': forms.ModelMultipleChoiceField, 'queryset':}
+ defaults = {'form_class': forms.ModelMultipleChoiceField, 'queryset':}
# If initial is passed in, it's a list of related objects, but the
# MultipleChoiceField takes a list of IDs.
Please sign in to comment.
Something went wrong with that request. Please try again.