[Zope] Wrong example in default ZClass constructors?
Ben Peter
Ben.Peter@t-online.de
Sat, 21 Apr 2001 08:40:54 +0200
Hi all,
playing around with the creation of ZClasses, I noticed that the examples given in the comments of the contructor method for new ZClasses will partly not work.
I have now figured out how to get things going, but I would like your thoughts on this before reporting it. Usually, things that I find are wrong are working smoothly and it was only me who has misunderstood ;-)
Here goes: the default constructor method uses the following:
<dtml-with "TestClass.createInObjectManager(REQUEST['id'], REQUEST)">
and suggests to change the new instance like this:
<dtml-call "propertysheets.Basic.manage_editProperties(REQUEST)">
within the <dtml-with> part.
I see two problems with that:
1.) the <dtml-with> should use the 'mapping' attribute. Otherwise, neither 'propertysheets' nor 'REQUEST' are available as used in the example.
2.) Even with the mapping, I get a name error for 'Basics'. This is probably due to the line being an example only. I am not very deep into ZClasses so far, perhaps someone can set me right here.
I used the following, which did fine:
<dtml-call "manage_changeProperties(REQUEST)">
but changed it to
<dtml-call "manage_changeProperties(title=REQUEST['title'])">
so that no random request parameters change unwanted properties.
Cheers,
Ben
--
Ben Peter - Feldstrasse 8 - 35091 Coelbe
Ben.Peter@t-online.de
ph: (+49) 6421 983520