Difficult question related to creating instances of objects...
This could be considered a difficult question. I want to have a set of objects that interrelate two kinds of information. Call the first one an "issue" and the second one a "paradigm." In a folder, there are mulitple issues and multiple paradigms. Some of the issues go with one or more paradigms. Other issues go with other paradigms. The issue and the paradigm are both ZClasses that I created. This is what I'm after.... Upon calling the issue_addForm, I want to have a list of the paradigms that reside within the calling folder. That way, the owner of the new object merely needs to click on an HTML list box in order to select the different paradigms. Ditto for editing the object. I could have created a set of properties (using the boolean, for example), but this would have made the class specific to a paradigm set. Instead, I want to generalize it so that I can simply add a new folder (with the appropriate index_html, etc.) and then add issue instances and paradigm instances and generate all lists dynamically based upon the content in the file. 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? Thanks in advance, Ron
create a dtml-method in a zclass lets call it: returnParadigms the content should be: <dtml-var expr="objectIds('paradigm')"> now create the property in the zclass select selection as type and select the function as value now the user should be able to select id's from the list cu ----- Original Message ----- From: "Ronald L. Chichester" <complaw@hal-pc.org> To: <zope@zope.org> Sent: Thursday, June 07, 2001 5:50 AM Subject: [Zope] Difficult question related to creating instances of objects...
This could be considered a difficult question.
I want to have a set of objects that interrelate two kinds of information. Call the first one an "issue" and the second one a "paradigm." In a folder, there are mulitple issues and multiple paradigms. Some of the issues go with one or more paradigms. Other issues go with other paradigms.
The issue and the paradigm are both ZClasses that I created.
This is what I'm after....
Upon calling the issue_addForm, I want to have a list of the paradigms that reside within the calling folder. That way, the owner of the new object merely needs to click on an HTML list box in order to select the different paradigms. Ditto for editing the object.
I could have created a set of properties (using the boolean, for example), but this would have made the class specific to a paradigm set. Instead, I want to generalize it so that I can simply add a new folder (with the appropriate index_html, etc.) and then add issue instances and paradigm instances and generate all lists dynamically based upon the content in the file.
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?
Thanks in advance,
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
"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 haven't had my first infusion of caffine yet this morning. But if I understand your question... 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. 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. Do the paradigms available to an issue span mutiple folders or are they all co-located? The former gets pretty tricky and is better implemented with a URL vs. just the ID. HTH, -- Tim Cook, President - FreePM,Inc. http://www.FreePM.com Office: (731) 884-4126 ONLINE DEMO: http://www.freepm.org:8080/FreePM
participants (3)
-
Ronald L. Chichester -
Tim Cook -
zope-mailinglist