[Zope] Using "Class-Hierarchies" in Zope

Andreas Pakulat ap125@informatik.uni-rostock.de
Fri, 06 Jun 2003 01:27:31 +0200


On 06.Jun 2003 - 01:01:50, Andreas Pakulat wrote:
> On 05.Jun 2003 - 22:34:26, Dieter Maurer wrote:
> > Andreas Pakulat wrote at 2003-6-5 15:28 +0200:
> >  , or do I have to reimplement all necessary
> >  > things from A_add in B_add?
> > 
> > You "A_add" probably contains 2 parts:
> > 
> >   1.  create a new "A" instance
> > 
> >   2.  initialize the new instance
> > 
> > Factor out part 2 (in a separate script inside your product).
> > Call it in both "A_add" and "B_add".
> 
> Hmm, I need the base class only to have some common properties and
> methods for several ZClasses. So the Base Class will never be used
> directly, so I onyl added a call to manage_editProperties from class A
> in the _add of B.

Got another problem with these both classes.

Class A (Base Class) has a Property character in the propertysheet
Attributes which is a multiple selection. I have the lines-Property 
in /. If I add an instance of Class B I can edit this character 
Property, the html-code is created with this:

<form action="B_add">
<select size="5" multiple>
<option tal:repeat="item here/B_character" tal:content="item"
tal:attributes="value repeat/item/index">
</select>
</form>

Now I have a View Prop, which connects to A/propertysheets/Attributes,
but if I click on the Prop tab of my new instance I get the following
error:

exceptions.TypeError

'in ' requires character as left operandTraceback (innermost last):
Module ZPublisher.Publish, line 150, in publish_module Module
ZPublisher.Publish, line 114, in publish Module ZPublisher.Publish, line
98, in publish Module ZPublisher.mapply, line 88, in mapply Module
ZPublisher.Publish, line 39, in call_object Module
Shared.DC.Scripts.Bindings, line 252, in __call__ Module
Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module
App.special_dtml, line 174, in _exec Module DocumentTemplate.DT_In, line
705, in renderwob Module DocumentTemplate.DT_In, line 705, in renderwob
Module DocumentTemplate.DT_Util, line 201, in eval - __traceback_info__:
getProperty Module , line 0, in ? TypeError: (see above)

Which is not very useful to me :(

I also tried to use tal:attributes="value item", but the result is the
same.

Andreas

-- 
You too can wear a nose mitten.