Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1886

Show
Ignore:
Timestamp:
02/04/08 21:18:15
Author:
fumanchu
Message:

Minor PG session refactor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/sessions.py

    r1868 r1886  
    399399    def __init__(self, id=None, **kwargs): 
    400400        Session.__init__(self, id, **kwargs) 
     401        self.cursor = self.db.cursor() 
     402     
     403    def setup(cls, **kwargs): 
     404        """Set up the storage system for Postgres-based sessions. 
     405         
     406        This should only be called once per process; this will be done 
     407        automatically when using sessions.init (as the built-in Tool does). 
     408        """ 
     409        for k, v in kwargs.iteritems(): 
     410            setattr(cls, k, v) 
     411         
    401412        self.db = self.get_db() 
    402         self.cursor = self.db.cursor(
     413    setup = classmethod(setup
    403414     
    404415    def __del__(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets