This tutorial provides a short introduction to developing with Zope 3. It provides an example of creating a content objects and associated views, adapters, and utilities. The skills learned here are applied in most facets of Zope 3 development.

We Zope to be much more approachable to Python programmers. You should be able to use existing Python objects in Zope with few changes. We want developers to be able to learn Zope a little bit at a time. We provide greater support for reuse through components.

Let’s look at a minimal class that is usable in Zope. As an example, we’ll use objects that manage personal information.

We normally organize our software into packages. We can put our packages anywhere, as long as they are in Zope’s Python path. We’ll create a buddydemo package in the src directory, which is in the Python path. We create an empty __init__.py file in buddydemo, so that Python will treat buddydemo as a package. We’ll create a buddy.py module to hold our class, named Buddy. The class is very simple. It stores information in attributes. It provides a single method that combines the first and last name. There are no Zope- specific mix- in classes. We do subclass Persistent. Doing so makes our life easier, because then Zope will manage our data in its object database. We don’t have to subclass Persistent. If we don’t though, we need to manage our data some other way (e.g. in a relational database).

Here are some pointers you might want to refer to when going through this course:
• The Zope 3 web site is http:/ / dev.zope.org/ Zope3
• Getting and installing Zope from Subversion: http:/ / dev.zope.org/ Zope3/ SettingUpAZope3Sandbox
• Coding style: http:/ / dev.zope.org/ Zope3/ CodingStyle

Download pdf Programming with the Zope 3 Component Architecture