[Zope] setting Zclass instance id based on properties

Small Business Services toolkit at magma.ca
Wed Dec 3 09:21:49 EST 2003


Re: [Zope] setting Zclass instance id based on propertCharlie 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zope.org/pipermail/zope/attachments/20031203/ab4b5bdf/attachment.html


More information about the Zope mailing list