Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Importing django.forms no longer requires DJANGO_SETTINGS_MODULE. Mov…

…ed django.db.connections import in django.forms.models to the method where it's used.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent e2627d2 commit 3a5b87cf6d9965b90ab744ee328e816ecc9855b7 @adrianholovaty adrianholovaty committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/forms/
4 django/forms/
@@ -3,7 +3,6 @@
and database field objects.
-from django.db import connections
from django.utils.encoding import smart_unicode, force_unicode
from django.utils.datastructures import SortedDict
from django.utils.text import get_text_list, capfirst
@@ -428,6 +427,9 @@ def _existing_object(self, pk):
def _construct_form(self, i, **kwargs):
if self.is_bound and i < self.initial_form_count():
+ # Import goes here instead of module-level because importing
+ # django.db has side effects.
+ from django.db import connections
pk_key = "%s-%s" % (self.add_prefix(i),
pk =[pk_key]
pk_field =

0 comments on commit 3a5b87c

Please sign in to comment.
Something went wrong with that request. Please try again.