Ticket #900: 900.1.patch

File 900.1.patch, 1.2 KB (added by Maniac <Maniac@…>, 19 years ago)

Preliminary patch

  • db/backends/postgresql.py

     
    4545            return self.connection.rollback()
    4646
    4747    def close(self):
     48        pass
     49
     50    def cleanup(self):
    4851        if self.connection is not None:
    4952            self.connection.close()
    50             self.connection = None
    5153
    5254    def quote_name(self, name):
    5355        if name.startswith('"') and name.endswith('"'):
  • handlers/modpython.py

     
    1111    def __init__(self, req):
    1212        self._req = req
    1313        self.path = req.uri
     14        req.server.register_cleanup(req,self._server_cleanup)
    1415
     16    def _server_cleanup(self,data):
     17        from django.core import db
     18        if hasattr(db.db,'cleanup'):
     19          db.db.cleanup()
     20
    1521    def __repr__(self):
    1622        return '<ModPythonRequest\npath:%s,\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s,\nuser:%s>' % \
    1723            (self.path, pformat(self.GET), pformat(self.POST), pformat(self.COOKIES),
Back to Top