On Sun, 2003-07-20 at 01:11, Randall Smith wrote:
> View.py
> *****************************************
> from WebKit.Page import Page
> 
> class View(Page):
>     def awake(self, transaction):
>        Page.awake(self,transaction)
>        id = self.request().field('id') # actually works now
>        #any initialization desired
> *****************************************
> 
> My psp (View.psp) can inherit from this and access 'id' or anything 
> created by the initialization code.  Seems to work great.  Do you see 
> any problems with this approach?  It would be nice to have the awake 
> method in Page call a 'dummy' method, Init, or something that can be 
> subclassed and used for initialization.  Is this feature already present 
> and I just missed it?

Ah, yes, that would cause that problem.  No, there's no plan to change
it.  However, I often do something like:

class SitePage(Page):

    def respond(self, trans):
        self.setup()
        Page.respond(self, trans)
        self.teardown()

    def setup(self): pass
    def teardown(self): pass

  Ian




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to