Charlie wrote:
I'm trying to create a context-based id based on the
properties.
There must be a way to customize the python constructor such
that instead of two steps there is a third step that reassigns the value of the
id based on properties *after* they are assigned.
I'm a designer, not a
programmer - can somebody help me out here?
I'm looking for someone to
fill in the third blank:
(1) Add a new instance of the ZClass
request
= context.REQUEST
instance =
container.MyZClass.createInObjectManager(request['id'], request)
(2)
update a property sheet from the form
values
instance.propertysheets.MyZClassProperties.manage_editProperties(request)
(3)
set id to be equal several properties (such as
section-chapter-book)
There is a manage_rename routine. I have never used it
myself (other than indirectly by clicking on the 'Rename' button on the ZMI
display) so I don't know the parameters required. I would guess it would
be something like:
<dtml-call "manage_rename(old_id, new_id)">
or
<dtml-call "old_id.manage_rename(new_id)">
or
<dtml-call "old_id.manage_rename(id=new_id)
If these don't work, try looking at the source or maybe
someone else on the mailing list has some experience with it.
HTH
Jonathan
Jonathan