Skip to content. | Skip to navigation

Personal tools
Sections
You are here: Home Blog Trying out Chameleon

Trying out Chameleon

by Ross Patterson last modified Oct 07, 2010 04:37 PM
My experiences with Chameleon, testing compatibility and z3c.form

I'm about to upgrade a sizable client deployment to Plone 4 and wanted to see if I could switch to the Chameleon template engine at the same time. I'm recording things I found here:

Testing both with and without Chameleon

For some add-ons of mine, I found it useful to be able to run the tests both with and without Chameleon. It turns out to be remarkably simple with buildout.

Integrating cmf.pt and z3c.form

There are some gotchas when using both cmf.pt and z3c.form together. You have to be sure to include z3c.ptcompat, which you can do with z3c.form's poorly named "extra" extras_require. I did this in my project's setup.py by adding the following:

      install_requires=[
...
          'z3c.form[extra]<2.3dev',
...

Unfortunately, z3c.ptcompat uses an environment variable to switch on the use of Chameleon so you have to add the environment variable to the buildout instances and test runners:

[instance]
...
environment-vars =
  PREFER_Z3C_PT True
...
[test]
...
environment = testenv
...
[testenv]
PREFER_Z3C_PT = True

Comments (1)

http://jstahl.org/ Oct 07, 2010 08:27 PM
Excellent! Something you may want to keep an eye on is Alan Runyan's PLIP at https://dev.plone.org/plone/ticket/11193, wherein he is about to make a big checkin of Chameleon-fixes for Plone 4. After that, the main obstacle to doing Chameleon in production deployments will likely be add-on product compatibility.
Navigation
OpenID Login

Contact

me@rpatterson.net

IRC: zenwryly@irc.freenode.net
plone.org: rossp
GTalk: mer@patterson.net
Yahoo IM: patterson_ross
AIM: rosspatters
MSN: me@rpatterson.net

PO Box 7775 #10587
San Francisco, CA
94120-7775

Phone
+1 (415) 894-5323