Django

Code

Ticket #3461: psycopg2.diff

File psycopg2.diff, 1.0 kB (added by Jack Moffitt <metajack@gmail.com>, 2 years ago)

pass through args and kwargs for calls to cursor()

  • django/db/backends/postgresql_psycopg2/base.py

    old new  
    2626        self.queries = [] 
    2727        self.options = kwargs 
    2828 
    29     def cursor(self): 
     29    def cursor(self, *args, **kwargs): 
    3030        from django.conf import settings 
    3131        if self.connection is None: 
    3232            if settings.DATABASE_NAME == '': 
     
    4343                conn_string += " port=%s" % settings.DATABASE_PORT 
    4444            self.connection = Database.connect(conn_string, **self.options) 
    4545            self.connection.set_isolation_level(1) # make transactions transparent to all cursors 
    46         cursor = self.connection.cursor(
     46        cursor = self.connection.cursor(*args, **kwargs
    4747        cursor.tzinfo_factory = None 
    4848        cursor.execute("SET TIME ZONE %s", [settings.TIME_ZONE]) 
    4949        if settings.DEBUG: