summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-01-18 07:09:39 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-01-18 07:09:39 +0200
commit3647c0a49a2f4535b8a9aba40e662743e4d53e76 (patch)
tree55b6207caf908afd5a480348a3f8ed34cb28ffba /django/forms
parent6158c79dbef832bc8530107ab2d34f04a04471da (diff)
Avoided unnecessary recreation of RelatedObjects
Refs #19399. Thanks to Track alias KJ for the patch.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/models.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index 1b6821cd5b..74886d7ae0 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -702,14 +702,11 @@ class BaseInlineFormSet(BaseModelFormSet):
"""A formset for child objects related to a parent."""
def __init__(self, data=None, files=None, instance=None,
save_as_new=False, prefix=None, queryset=None, **kwargs):
- from django.db.models.fields.related import RelatedObject
if instance is None:
self.instance = self.fk.rel.to()
else:
self.instance = instance
self.save_as_new = save_as_new
- # is there a better way to get the object descriptor?
- self.rel_name = RelatedObject(self.fk.rel.to, self.model, self.fk).get_accessor_name()
if queryset is None:
queryset = self.model._default_manager
if self.instance.pk: