Section 2.5. Summary


2.5. Summary

  • The TurboGears command tg-admin quickstart can create a brand new TurboGears project for you, complete with all the files you need to get started.

  • TurboGears publishes the methods defined in the root controller (which you can find in controllers.py).

  • TurboGears templates are standard XHTML documents, with a few extra processing directives.

  • TurboGears uses decorators such as @expose(template="hello.template.welcome") to determine which methods can be called directly from the web, and to define which template can be used to render the final page.

  • When your controller returns a dict, the contents of that dictionary are automatically available as local variables in your template.

  • If you're running Python 2.3, you can use decorators to define which objects are published, but with a slightly different syntax. All examples in this book use the standard Python 2.4 syntax, but there are Python 2.3 versions of some of the example code available at www.turbogearsbook.com.




Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net