Chameleon.zpt is a fast Zope Page Template implementation based on the Chameleon template compiler. It's largely compatible with zope.pagetemplate. Some benchmarks says Chameleon is 16x faster !
Chameleon page templates differ from standard Zope page templates in a few simple aspects which I propose to discover.

Chameleon templates and macros/slots for Grok Views

Use the "mypage" in a new template: mypage.cpt: <html metal:use-macro="path:context/@@mymacros/template/macros/mypage"> <!-- slot 'mycontent' was defined in the macro above --> <div metal:fill-slot="mycontent"> ... </div> </html>

Liens

Python Agility: be careful ;)Python is a very powerful dynamic programming language. Python is fun, yes!, but be careful it allows to do hair-raising thinks !!!https://www.boureliou.com/technoblog/blog/2009/python-agility-be-carefulhttps://www.boureliou.com/technoblog/blog/2009/python-agility-be-careful

Create an archetype content type with Paster and ZopeSkelZopeSkel provides a collection of skeletons for quickstarting Zope and Plone projects. These skeletons are available as PasteScript templates and can be used via the "paster" command line tool. This how-to describes how-to create a plone egg with an archetype content type in a fiew command lines.https://www.boureliou.com/technoblog/blog/2009/create-archetype-content-type-with-paster-and-zopeskelhttps://www.boureliou.com/technoblog/blog/2009/create-archetype-content-type-with-paster-and-zopeskel

ZopeSkel provides a collection of skeletons for quickstarting Zope and Plone projects. These skeletons are available as PasteScript templates and can be used via the "paster" command line tool. This how-to describes how-to create a plone egg with an archetype content type in a fiew command lines.

4. Add an archetype field to the new content-type

$ paster addcontent --list
Available templates:
[...]
atschema: A handy AT schema builder
[...]
$ paster addcontent atschema
[...]
Enter content_class_filename (What is the module (file)name of your content class?)
['exampletype']: mycontenttype
Enter field_name (What would you like to name this field?) ['newfield']: myfield
Enter field_type (What kind of field should I make for you?
Some examples: [computed,cmfobject,reference,text,image,float,lines,datetime,boolean,
file,integer,fixedpoint,string]) ['string']:
Enter widget_type (What kind of widget do you want to use
(example: Password)?) ['default']:
[...]

5. Links

6. Thanks

Many thanks; it's pretty straight forward in itself but certainly is handy to see what options are coming up for schema etc.

Posté par Dan Thomas le 06:37

This worked for me in Windows, and this may be useful to others:1) after cd to my product, I had to run paster with "..\paster"2) I could install the product by doing this from the product folder: "..\..\python.exe setup.py install"3) The message about Cheetah can apparently be ignored.

Thanks for a great write-up.

Using timezones in your Python scriptspytz allows accurate and cross platform timezone calculations using Python. Here is a small example on how to display date and time for differents timezones using a Zope Utility.https://www.boureliou.com/technoblog/blog/2009/using-timezones-in-your-python-scripts-zope-utilityhttps://www.boureliou.com/@@site-logo/logo.png