Aha, I just found this list, so will repost the conversation I've been  
having with myself so far tonight, in case anyone else has further  
insight.  Apologies to those who are getting this twice.

Begin forwarded message:

> From: David Glick <davidgl...@onenw.org>
> Date: December 20, 2008 4:14:11 AM PST
> To: Stefan Eletzhofer <stefan.eletzho...@inquant.de>, Adam Groszer 
> <agros...@gmail.com 
> >, Malthe Borch <mbo...@gmail.com>, Hanno Schlichting <hanno...@hannosch.eu 
> >
> Cc: Alexander Limi <l...@plone.org>, z3c_pt@googlegroups.com
> Subject: Re: chameleon and z3c.form
> Okay, now I'm using z3c.form trunk, and have adjusted the form  
> template factory in plone.z3cform to use the ViewPageTemplateFile  
> from five.pt if it's available.  And this is close to working...
> However I'm currently stuck because z3c.form's widget template  
> factory uses the ViewPageTemplateFile from z3c.pt (via  
> z3c.pt.compat) rather than the one from five.pt -- so it's missing  
> various variables that need to be there for compatibility with Zope  
> 2 and, particularly, certain widgets like kupu.
> So, any suggestions on how we can make z3c.form and/or z3c.pt.compat  
> use the ViewPageTemplateFile from five.pt when integrating with Zope  
> 2 and chameleon?  (If I temporarily hack this into z3c.pt.compat  
> then things work fine.)
> thanks...
> David
> On Dec 20, 2008, at 1:48 AM, David Glick wrote:
>> Whoops, somehow I missed the z3c.pt.compat integration on z3c.form  
>> trunk.  Never mind, I think...
>> peace,
>> David
>> On Dec 20, 2008, at 12:27 AM, David Glick wrote:
>>> Hello!
>>> E-mailing you guys directly because I couldn't find a mailing list  
>>> for chameleon...if there's a good place to discuss this publicly  
>>> please cc it on the reply.
>>> Have any of you looked into making chameleon work with z3c.form on  
>>> Zope 2.12?  As things stand we end up with old Zope 2 page  
>>> templates for z3c forms -- the reason is that five.pt relies on  
>>> patching ViewPageTemplateFile's __get__ method to return a  
>>> chameleonified BoundPageTemplate, but z3c.form finds its templates  
>>> via an adapter lookup, so they are never accessed as an attribute  
>>> and the __get__ method is never used.
>>> I was able to work around this by modifying the __call__ method of  
>>> z3c.form/form.py's FormTemplateFactory as follows:
>>>     def __call__(self, form, request):
>>>         if hasattr(self.template, '__get__'):
>>>             return self.template.__get__(form, None)
>>>         else:
>>>             return self.template
>>> Plus a similar modification in z3c.form/widget.py's  
>>> WidgetTemplateFactory.
>>> But I'm not sure whether this is the right fix, or the right place  
>>> for a fix.  Any thoughts?
> David Glick
> Web Developer
> ONE/Northwest
> New tools and strategies for engaging people in protecting the  
> environment
> http://www.onenw.org
> davidgl...@onenw.org
> work: (206) 286-1235 x32
> mobile: (206) 679-3833
> Subscribe to ONEList, our email newsletter!
> Practical advice for effective online engagement
> http://www.onenw.org/full_signup

You received this message because you are subscribed to the Google Groups 
"z3c.pt" group.
To post to this group, send email to z3c_pt@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to