[Zope] Difficult question related to creating instances of

complaw@hal-pc.org complaw@hal-pc.org
Thu, 7 Jun 2001 16:15:36 GMT


> "Ronald L. Chichester" wrote:
>  
> > The bottom-line question is, can I make a list for an HTML list box with
> > the contents of the folder that calls the addForm method?
> 
> I found that the power of using ZClasses was in being able to
> define a META TYPE.  This gives you a lot of handling
> capabilities in many situations.  So instead of having one Zclass
> with a boolean to select whehter it's an issue or a paradigm. I
> would create two separate Classes.  The overhead is pretty small
> compared to what you get back in power.

I am using two ZClasses.  One for the paradigm (which has one set of properties)
and another for the issues (with yet another set of properties).  Both classes
do different things.  They are, however, related in that they reference each
other.  The question then becomes how to contain those references.  One of the
classes has to maintain a reference.  Note, one issue can reference multiple
paradigms.  Each paradigm, in turn, may reference several issues.  The
reference-back (when viewing the paradigm) can be done (I think) through dtml by
picking out those issues that contain the link to the paradigm in question.  I
wanted to adopt this technique because it is scalable and flexible. 

I could have created a set of classes with direct links (e.g., boolean
properties that indicate whether a particular issue contains one of the
paradigms.  This would be fine for one subject (the subject being a set of
paradigms and issues).   However, I would have had to derive a whole new class
for each subject.  The method I'm trying to work out here would be flexible
enough to work on mulitiple subjects without having to change/create a new
product.  All the content developer need to is pick the same product whenever he
wanted to set up something like this.


> 
> For the association part, your issue will need a lines property
> that will contain the associated paradigm ID's. When you add an
> issue and select the paradigms from the multi-select then your
> form handler will have a list of paradigms to fill this property
> with.
> 

Correct.  That is the goal.  The problem comes on how to load the list of
paradigms into the add_form/edit_form for the ZClass.

> Do the paradigms available to an issue span mutiple folders or
> are they all co-located?  

Yes.  All of the paradigms and issues reside in the same folder (that is called
a "subject" folder).  In fact, we don't want to mix paradigms/issues with other
folders.


> The former gets pretty tricky and is
> better implemented with a URL vs. just the ID.  

I would agree to that.

Thanks,

Ron