[Zope] setting Zclass instance id based on properties
Small Business Services
toolkit at magma.ca
Wed Dec 3 09:42:43 EST 2003
Re: [Zope] setting Zclass instance id based on propertmanage_rename can be found in OFS/CopySupport.py
Jonathan
PS please make sure your posts are sent to the group
----- Original Message -----
From: Charlie Kalech
To: Small Business Services
Sent: December 3, 2003 8:17 AM
Subject: Re: [Zope] setting Zclass instance id based on properties
Thanks Jonahan -
I'll give it a shot - any idea where in the source I would look?
Charlie
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
--
Charlie Kalech
Director, J-Town Productions Ltd.
_________________________________
Designing Web Sites Since 1994
_________________________________
E-Mail: mailto:Charlie at J-Town.co.il
URL: http://www.j-town.co.il
POB 10243 Jerusalem 91102 ISRAEL
Tel: 972-2-671 9918
Fax: 972-2-672 1245
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zope.org/pipermail/zope/attachments/20031203/f4279236/attachment.html
More information about the Zope
mailing list