[Zope] Simple q'n but driving me crazy

Thomas Weiner weiner@tu-harburg.de
Mon, 28 Feb 2000 16:44:27 +0100


Tom Deprez schrieb:
> 
> I tried several things but none gave a good result :-(
> 
> I've a property sheet call InstanceConstants. Assume there is a property
> called 'Category'.
> 
> Now how can I automatically fill this value with a string, thus not through
> addForm (user intervention)?
> 
> eg. Category = 'TEST'
> 
> I assume this piece of code has to be placed in the _add method, but how
> does it look like?
> 
>        <dtml-call "REQUEST.set('Category','TEST')">
> 
> doesn't work and all my other trials with using the propertysheets names
> etc don't work either :-(

In your constructor method you something like

<dtml-with "Your_Zclass.createInObjectManager(REQUEST['id'], REQUEST)">
  <dtml-call "REQUEST.set('Category','TEST')">
  <dtml-call
"propertysheets.InstanceConstants.manage_editProperties(REQUEST)"> 
</dtml-with>

should work. There's a short description about this in the constructor
method, when it is added to your ZClass by default.

hth,
Thomas