cybertools/web
helmutm 5f9675c871 separated ZPT-based template implementation
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1521 fd906abe-77d9-0310-91a1-e0d9ade77398
2006-11-24 16:00:35 +00:00
..
zpt separated ZPT-based template implementation 2006-11-24 16:00:35 +00:00
__init__.py added web sub-package for generic view support and other web- and browser-related stuff 2006-11-24 15:48:14 +00:00
README.txt separated ZPT-based template implementation 2006-11-24 16:00:35 +00:00
template.py separated ZPT-based template implementation 2006-11-24 16:00:35 +00:00
tests.py added web sub-package for generic view support and other web- and browser-related stuff 2006-11-24 15:48:14 +00:00
view.py separated ZPT-based template implementation 2006-11-24 16:00:35 +00:00

===============================
All about Views, Templates, ...
===============================

$Id$


Generic Views
=============

OK, there aren't really generic views. Already the first implementation we
want to look at is a specic one: It is based on Zope Page Templates and
uses the classic CMF/Zope 3 approach: The template belonging to a view
calls a `main` macro and fills a slot there. But at least the template
implementation is decoupled from the view, so we are able to put a lot of
generic functionality into the view.

But in order to make a ZPT work we need a Zope-compatible request, so we use
the standard Zope 3 TestRequest.

  >>> from zope.publisher.browser import TestRequest

  >>> from cybertools.web.view import View
  >>> view = View(None, TestRequest())
  >>> view.render()
  u'<html...>...<body...>...</body>...</html>...'