Commit 62355d82 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

[1.2.X] Fixed #13798 -- Added connection argument to the connection_created...

[1.2.X] Fixed #13798 -- Added connection argument to the connection_created signal. Thanks to liangent for the report, and Alex Gaynor for the patch.

Backport of r13672 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13674 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 2c82a2aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class DatabaseWrapper(SqliteDatabaseWrapper):
            self.connection.create_function("django_extract", 2, _sqlite_extract)
            self.connection.create_function("django_date_trunc", 2, _sqlite_date_trunc)
            self.connection.create_function("regexp", 2, _sqlite_regexp)
            connection_created.send(sender=self.__class__)
            connection_created.send(sender=self.__class__, connection=self)

            ## From here on, customized for GeoDjango ##

+1 −1
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
            self.connection = Database.connect(**kwargs)
            self.connection.encoders[SafeUnicode] = self.connection.encoders[unicode]
            self.connection.encoders[SafeString] = self.connection.encoders[str]
            connection_created.send(sender=self.__class__)
            connection_created.send(sender=self.__class__, connection=self)
        cursor = CursorWrapper(self.connection.cursor())
        return cursor

+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
                # Django docs specify cx_Oracle version 4.3.1 or higher, but
                # stmtcachesize is available only in 4.3.2 and up.
                pass
            connection_created.send(sender=self.__class__)
            connection_created.send(sender=self.__class__, connection=self)
        if not cursor:
            cursor = FormatStylePlaceholderCursor(self.connection)
        return cursor
+3 −2
Original line number Diff line number Diff line
@@ -135,8 +135,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
            if settings_dict['PORT']:
                conn_string += " port=%s" % settings_dict['PORT']
            self.connection = Database.connect(conn_string, **settings_dict['OPTIONS'])
            self.connection.set_isolation_level(1) # make transactions transparent to all cursors
            connection_created.send(sender=self.__class__)
            # make transactions transparent to all cursors
            self.connection.set_isolation_level(1)
            connection_created.send(sender=self.__class__, connection=self)
        cursor = self.connection.cursor()
        if new_connection:
            if set_tz:
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
            self.connection = Database.connect(**conn_params)
            self.connection.set_client_encoding('UTF8')
            self.connection.set_isolation_level(self.isolation_level)
            connection_created.send(sender=self.__class__)
            connection_created.send(sender=self.__class__, connection=self)
        cursor = self.connection.cursor()
        cursor.tzinfo_factory = None
        if new_connection:
Loading