I know, it's a naive question :-)
Originally poped up into my mind over Zope 2: How to properly “browser:page” to make a page available everywhere?
I know, it's a naive question :-)
Originally poped up into my mind over Zope 2: How to properly “browser:page” to make a page available everywhere?
Views are callable adapters that provide output based on the context and the request.
Templates are callables that render a piece of text based on a template. They are often used in views.
Note that views can return text without using a template:
from zope.publisher.browser import BrowserView
class MyView(BrowserView):
def __call__(self):
return "Hello world, I am located at {0}".format(self.context.absolute_url())
Views can also be used by other Zope code, without themselves being published. Zope code uses a lot of views internally.