[Zope-dev] Re: bug in ZopePageTemplate.py?

Andreas Jung lists at zopyx.com
Wed Dec 5 02:48:36 EST 2007



--On 10. November 2007 11:02:27 +0000 Chris Withers 
<chris at simplistix.co.uk> wrote:

> Tres Seaver wrote:
>>> MailTemplates subclass ZopePageTemplate and expect to be text/plain by
>>> default...
>>
>> That code is there only when reading from the default content, right?
>
> Yep.
>
>> And that file is *definitely* 'text/html'.
>
> Well, not in the subclass no...
>
>> Why don't you just override it at class level in the subclass?
>
> Yeah, that's what I've done, but it seems a shame to have to replace the
> whole __init__ method just for this one line...
>
>> For
>> instance, override '__init__' to read your file before calling the
>> 'super' version, and pass its contents through as 'text', along with
>> your desired 'content_type'.
>
> Fair enough.
>
> That said, since then, I've been trying to fix other test failures and
> have been pretty disappointed with the way it's been done. A lot of
> assumption has been made that text/html and text/xml are the only content
> types that will ever be used and there are several edge cases where
> things break when the content type is not one of these two :-(
>

If you have a better solution, please submit a patch :-)

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20071205/987edd57/attachment.bin


More information about the Zope-Dev mailing list