Thanks for the example.

The way that seemed natural to me for working with Cheetah was to create a
HTML template with placeholders like $content :

Then :

class sitePage(Page):
    def __init__(self):
        Page.__init__(self)
        self.template = Template("<html><body>$content</body></html>")

    def writeHTML(self):
        self.template.content = self.getContent()
        self.write(self.template)

    def getContent(self):
        return "Override this in derived classes"

So the SitePage would provide the template and I'd just override getContent
in child classes to subsitute in the value.

I guess my fundamental disconnect is at this level :

class Login(SitePage, FormServlet):
        def __init__(self):
                FormServlet.__init__(self, 'writeContent', formDefs)
                SitePage.__init__(self)

Because instead of overwriting 'writeContent' to push itself into the output
at the right place with self.write() I want to plug the output of the
FormServlet into a return from getContent().

I can feel I'm being stupid but I just can't see round it. Any light you can
shine would be very welcome.

- Ian Sparks.

-----Original Message-----
From: Aaron Held [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 9:42 AM
To: Ian Sparks; [EMAIL PROTECTED]
Subject: Re: [Webware-discuss] Using FunFormKit & Cheetah


Login.py uses FFK and Cheetah with them template embedded as a
variable in the file

EditUser.py uses FFK and the external template EditUser.ctd.
(ctd is my own extention, you may want to follow the convention
and use .tmpl) EditUser.ctd includes the bizzar newline fix that
you need to use to add a "\n" into javascript

-Aaron Held


----- Original Message -----
From: "Ian Sparks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 5:48 PM
Subject: [Webware-discuss] Using FunFormKit & Cheetah


> I searched the back-messages and saw that people had attempted
to post
> examples of FunFormKit and Cheetah integration but GeoCrawler
seemed to have
> dropped the attachments.
>
> Could someone post an example of integrating these two
products?
>
> Many thanks.
>
> - Ian Sparks.
>
>
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>

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

Reply via email to