Discussion:
chameleon and z3c.form
David Glick
2008-12-20 12:18:58 UTC
Permalink
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.
peace,
David
Date: December 20, 2008 4:14:11 AM PST
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
Whoops, somehow I missed the z3c.pt.compat integration on z3c.form
trunk. Never mind, I think...
peace,
David
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
return self.template.__get__(form, None)
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
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 ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...