[ZPT] PageTemplateFile again. Why Antipersistent??

Chris Withers cwithers at gmail.com
Wed Aug 25 02:26:05 EDT 2004


Axel Müller wrote:
> Hi,
> I've got it.(for mor info please have a look at my last mail in Thread
> "PageTemplateFile").
> 
> HtmlFile, ImageFile etc. can be added to instances in ZODB:
> 
> setattr(self,'name',HTMLFile('asdfad',globals()))
> 
> (replace HTMLFile as needed)

...but REALLY shouldn't. Seriously, that's not what they're designed for.

> But why is this nessesary and is there a way to pass this?

What you really want is to instantiate a normal PageTemplate object, set 
it as the attribute of your class instance, and then call it's edit 
method with the data you read off the filesystem.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the ZPT mailing list