J�rn Schrader <[EMAIL PROTECTED]> wrote:
> I would like to use MiddleKit in a WebKit Application. Can anyone describe
> the best way to embed a middlekit store in the WebKit Application, so that I
> dont have to open it for each request.

I have a SitePage class that all pages inherit from.  I include a
method:

        def store(self):
                if not hasattr(self, "_store"):
                        self._store = MySQLObjectStore(user='username', 
passwd='password')
                        self._store.readModelFileNamed(os.path.join('Gallery'))
                return self._store

Then I just call self.store() to get the store.

It might be better to do:

    def store(self):
        try:
            return self._store
        except AttributeError:
            self._store = [...]
            return self._store

  Ian

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to