[Zope3-Users] need guidance

Brad Allen brad at allendev.com
Tue Nov 29 17:45:26 EST 2005

I'm still in the midst of an effort at learning Zope 3, while try to 
build a real website for it. I have ambitions for using Zope 3 in 
several different projects, and am actively working on a Zope 3 
website that I hope to have looking presentable if not fully 
functional by mid-December. It will probably look a lot like a static 
site at first, with a few added features like messageboard 
functionality (I hope it will be ok for me to use MessageBoard from 
Stephan Richter's book for a non-profit site). Later we will want to 
add features for wiki, blogging, event calendar, and document library.

Another Zope 3 project for the future is to convert an ecommerce site 
I had previously built in PHP. I've been using Python at my day job 
now for a couple of years, and have decided I no longer have time for 
PHP--I want to switch the site to Python, probably using Zope 3. 
This site's main purpose is to allow customers to search, view, and 
purchase from a catalog of auto parts.

With these two different types of sites in mind, some design 
questions have come up in relation to Zope 3.

For the auto parts site, I am thinking about designing an AutoPart 
content component. This will allow the business owner to edit his 
catalog of auto parts via the web. Suppose he starts instantiating a 
lot of auto parts, and editing them. Later, we decide we need to 
refactor the base class, and maybe create a few child classes. That 
leaves me with a big cleanup chore, because a lot of old AutoPart 
instances are sitting around in the database.

What's the normal pattern for dealing with this kind of cleanup? Am I 
better off just using SQL tables to provide persistence, and not 
storing my object instances in ZODB? At least with SQL, it's easy 
enough to manipulate the content data, and just re-instantiate 
AutoPart objects from SQL when needed.

I'm trying to come to an understanding of when it's best to keep data 
in the ZODB, and when it's best to use SQL instead. Maybe there are 
tools for handling ZODB data that I don't know about.

Another question about ZODB is whether to use it to store page 
templates. If I build a lot of ZPT pages and macros and store them 
through the ZMI, and then later want to rearrange the folder 
structure, I'm guessing it will be a pain to change a lot of 
hard-coded path references. If I use text files outside the ZODB, 
then I can use a host of text editor tools for searching across 
multiple files.

I like the idea of letting end users have something like the ZMI for 
editing content, and am hoping it will be possible avoid putting much 
TAL and METAL markup in documents in the ZMI, but rather have the .pt 
files pull content from the ZODB. However, it's not clear to me how 
to make that work. The examples in the books have the .pt files in 
the filesystem; I don't recall seeing any the ZMI/ZODB.

Here is another question. Suppose I'm working with a team of 
developers. Should we each set up our own separate Zope3 instance, 
and do SVN checkouts into our own separate, local /lib/python 
directories inside the instance? How then would we merge any changes 
done in the ZODB? On the other hand, having all team members try to 
share a single Zope 3 instance seems unworkable...

Thanks for any insights you can provide.

More information about the Zope3-users mailing list