Chapter 13.4. Summary

  • Kid always produces valid XML, so you don’t have to worry about invalid output.

  • Kid’s py:content, py:strip, and py:replace are designed to enable you to add dynamic content to your page. You can also use the ${} syntax to drop strings into your page.

  • Kid provides the py:if, py:for, and py:def processing directives to control program flow and make reuse possible.

  • The py:match processing directive makes it possible to add dynamic content to templates in an XML-specific way that allows for all kinds of powerful transformations.

  • The py:extends directive allows you to keep reusable named template functions (py:def) and match templates in a central location to be “inherited” by multiple templates.

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.