A newbie question - ZClasses, contents, and so on...
Hi, everybody. I'm trying to understand just how ZClasses work, and have decided to create a simple message board system with my ever-so-slowly growing knowledge. My model is this: A forum may contain multiple topics, each of which has a name. A topic, in turn, may contain several messages (each of which has an author and some content). (Yes, I know that ZDiscussions does this, but perusing the source hasn't helped me much.) After flailing at the problem for a while, I've tried two different approaches. 1) Each of the classes (Forum, Topic, and Message) are created in the 'CForums' product I've made. Forum and Topic both use ObjectManager as a base class, so they can contain other items (Topics and Messages, respectively). This works well as long as I create Topics and Messages manually, through the Zope admin screen, but I was unable to discover how to automate the process so a normal web user could do it. I simply couldn't figure out how to get to the Topic methods from within a Forum object, and so on. 2) Topic is a ZClass in the methods area of Forum, and Message is a ZClass inside of Topic. This works well enough, except that I can't specify Topic as a sub-object of Forum, and so on. Consequently (at least, I *think* it's a consequence of this), I can't use things like objectValues or objectIds to get to the 'contents' of a Forum, even though there are definitely messages tucked away inside. How should I be approaching this problem? I don't really need hand-holding, but a healthy shove in the right direction would be greatly appreciated. Thanks for any help you can offer. --- Chris
From: Carlson, Christopher W.
How should I be approaching this problem? I don't really need hand-holding, but a healthy shove in the right direction would be greatly appreciated.
I tried to write you a reply, but it turned out that it would take a humungus amount of time, so instead I will give some general advice. I really think that you should try out the examples in the Zope book first, as what you are embarking on can be quite difficult if you don't "grok the Zen" so to speak. When you have done the book, you will probably know how to do what you are trying to. regards Max M
"Carlson, Christopher W." wrote:
Hi, everybody. I'm trying to understand just how ZClasses work, and have decided to create a simple message board system with my ever-so-slowly growing knowledge.
My model is this: A forum may contain multiple topics, each of which has a name. A topic, in turn, may contain several messages (each of which has an author and some content).
[snip]
of a Forum, even though there are definitely messages tucked away inside.
How should I be approaching this problem? I don't really need hand-holding, but a healthy shove in the right direction would be greatly appreciated.
Thanks for any help you can offer.
--- Chris
Check out: http://www.zope.org/Members/tazzzzz/addZClasses -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (3)
-
Carlson, Christopher W. -
Casey Duncan -
Max M