Hi - It would be really nice to have the session store class and session 
classes fully configurable from the Application.config file. Currently 
Webware is limited to the included Memory/File/Dynamic setting which is 
translated into ("Session%sStore" % setting) and used to import the 
store. Then the session class is hard-coded as Session in the Application.

What do you think of having config settings for importing custom session 
stores and session classes for use by the app? I built a custom store 
for one application that happens to use MySQL as the back-end, coupled 
with a custom Session object, and I have to jump through some hoops to 
get the app to use them.

It could be as simple as four new config settings:

SessionStoreModule
SessionStoreClass
SessionModule
SessionClass

The Application object could do the same process it does now to import 
SessionXxxStore. Something like this (rough, untested):

CURRENT:
    # For session store:
    sessionStore = 'Session%sStore' % self.setting('SessionStore')
    exec 'from %s import %s' % (sessionStore, sessionStore)
    klass = locals()[sessionStore]
    assert isinstance(klass, ClassType) or issubclass(klass, Object)
    self._sessions = klass(self)

NEW:
    # For session store:
    exec 'from %s import %s' % (self.setting('SessionStoreModule'), 
self.setting('SessionStoreClass'))
    klass = locals()[self.setting('SessionStoreClass')]
    assert isinstance(klass, ClassType) or issubclass(klass, Object)
    self._sessions = klass(self)
    # For session class:
    exec 'from %s import %s' % (self.setting('SessionModule'), 
self.setting('SessionClass'))
    klass = locals()[self.setting('SessionClass')]
    self._session = klass

If there is interest in this, I can whip up a patch. I can include 
support for the current "SessionStore" param as well, rather than force 
a change to config files.

Thanks - Ben

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to