While some people immediately understand the usefulness of Zope, others don't understand how to apply their skills. In this article, Peyton McCullough explains how to apply the skills to create a simple forum.
In this tutorial, we will be exploring the basics of creating Web applications in Zope. We will use Zope Page Templates and a bit of Python to create a primitive forum system. Yes, primitive. Note that what we create will not be the best in its category, and this is certainly not the only way to create a forum. With that stated, however, you will still end up with a fully functional application.
A basic understanding of Zope and Zope Page Templates will be useful in this article. Knowledge of acquisition might also help because we will use it to create our forum.
Let's get started.
Let's try to keep our forum as simple as possible. When the user first accesses the forum, he or she will see a list of categories. The categories will be drawn from the folders contained in our forum's main directory. So, for example, if I created a folder with an ID of test and a title of Category One, a category named "Category One" would appear on the index page.
When the user clicks on a category, he or she will be taken to a list of topics in the category. The topics, as with the categories, will be drawn from folders within the category's folder. If no topics are present in the category, a message will state this fact. At the bottom of the topic index, there will be a form for adding new topics with fields for the subject, author and message of the topic.
Clicking on a topic will bring the user to a list of replies to the topic. Replies will be drawn from files within the topic's folder. The contents of the file will be the reply's message, and a property named author would be added to the file. A form for adding new replies will be at the bottom of the topic's page, with fields for the author and messages of the reply.
For simplicity's sake, users will not have to register in order to post. There will be no user database system present in our forum, nor will there be any bells and whistles, such as moderation or administration features. However, feel free to expand the forum system for extra practice.
Here's a short example that shows our forum's structure: