Commits

Anonymous committed 505fd08

Fixed bug where assigning a connection though Class.objects.db would raise a NameError.

Comments (0)

Files changed (1)

django/db/__init__.py

 
     def __set__(self, instance, value):
         try:
-            self.local.cnx[instance] = instance_connection
+            self.local.cnx[instance] = value
         except AttributeError:
             # First access in thread
-            self.local.cnx = {instance: instance_connection}
+            self.local.cnx = {instance: value}
 
     def __delete__(self, instance):
         try: