Re: [Zope] ZClass newbie problem...

2000-06-14 Thread Kevin Dangoor

- Original Message -
From: "Eric L. Walstad" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 13, 2000 12:30 AM
Subject: [Zope] ZClass newbie problem...


 I'm stuck. I would like to build a "shiny new ZClass" that has the
following
 structure:

 WebSimProduct
   WebSim Class
 'Properties' Property Sheet
   string RunID
 Calc Class Object
   'Properties' Property Sheet
 PathToInputFile
 PathToWxFolder
   Results Class Object
 'Properties' Property Sheet
   float gashtg
   float elchtg
   float elcclg
   float euihtg
   float euiclg

 I haven't seen anything in the Zope documentation on using Zclass
instances
 as members of a super class.  In other programming languages I would
 instantiate default objects when the WebSim class is initialized.  That
way,
 to use a WebSim object, all I would need to do is instantiate one, then
fill
 the properties of the automatiacally-created Calc object and Results
object.
 However, I'm not sure how to build these default objects in Zope.

 My next question is: do I have to build a bunch of products (one for the
 Calc class and one for the Results class, for example)?  I can imagine
this
 would result in a huge number of products under the control panel if this
is
 the case.  I would like to have just a WebSim product and have all the
other
 classes defined within this product.  Does Zope work this way?  If not,
how
 is this class structure (or one similar) achieved?

You can certainly have multiple ZClasses within a single Product. Some
people recommend not nesting ZClasses, because when you do so you can only
use the nested classes within the top level class... ZClasses can't be
cut-and-pasted, so you're stuck with that hierarchy. If you're sure you only
want to add those classes in that particular way, you can pretty easily do
what you want.

In the WebSim_add method, you would do something like:

dtml-with "createInObjectManager..."this line is already there
 dtml-with "Calc_add(_.None, _)"
  ...set your properties here...
   dtml-with "Results_add(_.None, _)"
 ...set your Results properties here...
/dtml-with
  /dtml-with
/dtml-with

HTH,

Kevin


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] ZClass newbie problem...

2000-06-12 Thread Eric L. Walstad

I'm stuck. I would like to build a "shiny new ZClass" that has the following
structure:

WebSimProduct
  WebSim Class
'Properties' Property Sheet
  string RunID
Calc Class Object
  'Properties' Property Sheet
PathToInputFile
PathToWxFolder
  Results Class Object
'Properties' Property Sheet
  float gashtg
  float elchtg
  float elcclg
  float euihtg
  float euiclg

I haven't seen anything in the Zope documentation on using Zclass instances
as members of a super class.  In other programming languages I would
instantiate default objects when the WebSim class is initialized.  That way,
to use a WebSim object, all I would need to do is instantiate one, then fill
the properties of the automatiacally-created Calc object and Results object.
However, I'm not sure how to build these default objects in Zope.

My next question is: do I have to build a bunch of products (one for the
Calc class and one for the Results class, for example)?  I can imagine this
would result in a huge number of products under the control panel if this is
the case.  I would like to have just a WebSim product and have all the other
classes defined within this product.  Does Zope work this way?  If not, how
is this class structure (or one similar) achieved?

BTW, I've read, and disected to the best of my ability, the Zope Developer's
Guide and the Searchable Job Board HowTo and Ta'sss Adding ZClass
Instances Programmatically and the Zope Content Manager's Guide 'Turining an
Application into a Product.'  However none of these deals with classes that
contain custom class objects.

Thanks for the guidance (TFTG?)!

Eric.


___
Zope maillist  -  [EMAIL PROTECTED]
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 )