<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: [Zope] setting Zclass instance id based on
propert</title></head><body>
<div>I'm trying to create a context-based id based on the
properties.</div>
<div><br></div>
<div>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.</div>
<div><br></div>
<div>I'm a designer, not a programmer - can somebody help me out
here?</div>
<div><br></div>
<div>I'm looking for someone to fill in the third blank:</div>
<div><br></div>
<div>(1)<font face="Geneva" color="#000000"> Add a new instance of the
ZClass</font></div>
<div><font face="Geneva" color="#000000">request =
context.REQUEST</font></div>
<div><font face="Geneva" color="#000000">instance =
container.MyZClass.createInObjectManager(request['id'],
request)</font></div>
<div><br></div>
<div>(2)<font face="Geneva" color="#000000"> update a property sheet
from the form values</font></div>
<div><font face="Geneva"
color="#000000"
>instance.propertysheets.MyZClassProperties.manage_editProperties(req<span
></span>uest)</font></div>
<div><font face="Geneva" color="#000000"><br></font></div>
<div><font face="Geneva" color="#000000">(3) set id to be equal
several properties (such as section-chapter-book)</font></div>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
<div>At 13:11 -0500 12/2/03, Small Business Services wrote:</div>
<blockquote type="cite" cite>Charlie Kalech wrote:<br>
&gt; I would like to set the id of a Zclass instance based on some of
the<br>
properties<br>
&gt;<br>
&gt; I can not use the property variables in the add method since
the<br>
&gt; properties have not yet been assigned a value<br>
&gt;<br>
&gt; For instance let's say I have three properties: Section, Chapter
and Page<br>
&gt;<br>
&gt; How do I assign the id the value &lt;dtml-var
Section&gt;-&lt;dtml-var<br>
&gt; Chapter&gt;-&lt;dtml-var Page&gt; when I create the zclass
instance?<br>
<br>
There is no data in the 'Section', 'Chapter' or 'Page' until after
you<br>
create an instance of your ZClass and assign some value to the
properties.<br>
The property fields of a ZClass are just 'field names' until you
create an<br>
instance of that ZClass, so you can't do anything with them.<br>
<br>
What are you trying to accomplish?<br>
</blockquote>
<blockquote type="cite" cite>Jonathan</blockquote>
<div><br></div>
</body>
</html>