[Zope] creating cross-product classes

Ingo Assenmacher Ingo.Assenmacher@post.rwth-aachen.de
Thu, 10 Feb 2000 17:14:02 +0100


Hi!

So, this MUST be simple to solve, but alas, I just can not figure it
out:

I have produced a product with some zclasse in it.
Now, I want to use one or two of those classes within a new product by
creating them using a constructor call of a new object.

So, to make this clear, this is it:

upProduct
  | class A
  | class B

newProduct
  | class Z
  |  class_Z_add (DTML-constructor method)
  |   <dtml-comment> We add the new object by calling the class in
                a with tag.  Not only does this get the thing
                added, it adds the new thing's attributes to
                the DTML name space, so we can call methods
                to initialize the object.

Imagine Z is a folder and I want to initialliy create some objects
within (probably from other products)

<dtml-call "b_add(_.None, _ )">  

that does not do the trick (obviously).

Then I found a hint (http://www.zope.org/Members/tazzzzz/addZClasses)
which gave a hint on this:
<quote>
If you are trying to add a ZClass instance from elsewhere in the ZODB,
it's just a couple of lines more that are necessary:

      <dtml-with "manage_addProduct['YourProduct']">
          <dtml-call "YourZClass_add(_.None, _, NoRedir=1)">
      </dtml-with>
</quote>

This raised an Attribute Error ( _u ??<- what is this))

So, how do I do this?

Thanks for ANY HELP!!

Regards, Ingo.