[Zope] How to add valuables into Property sheets from a form?

cooper, cameron cameron.cooper@pantellos.com
Fri, 22 Jun 2001 16:14:06 -0500


This is a multi-part message in MIME format.

------_=_NextPart_001_01C0FB60.454BFFEC
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

>>>
	I can't get those valuables to store into property
	sheets.
	Seems those valuables never been read by Zclass (or I
	should say constructor???)
<<<

What you need to do is call

"propertysheets.PROPERTYSHEETNAME.manage_changeProperties(REQUEST)"

for every property sheet you want to update. (Note that it is not edit
but change that you should use.) You would have five of these, one for
each property sheet. All attibutes in the property sheet matching a key
from the REQUEST will be updated with the value from the REQUEST
associated with the key.

I do this in a PythonScript, but it should work with dtml-call as well.

Also, unless you're changing the default catalog of a (presumably)
CatalogAware object, with manage_editCataloger, I don't think you need
to reindex. And if you do, it should go after you change the properties.
And it should probably be a plain index, since it never was in that
catalog in the first place. At least that's what work for me.

		--jcc
	(yay objects!)

------_=_NextPart_001_01C0FB60.454BFFEC
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4419.22">
<TITLE>Re: [Zope] How to add valuables into Property sheets from a =
form?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=3D2>&gt;&gt;&gt;</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>I =
can&#8217;t get those valuables to store into property</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>sheets.</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>Seems =
those valuables never been read by Zclass (or I</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>should say =
constructor???)</FONT>

<BR><FONT SIZE=3D2>&lt;&lt;&lt;</FONT>
</P>

<P><FONT SIZE=3D2>What you need to do is call</FONT>
</P>

<P><FONT =
SIZE=3D2>&quot;propertysheets.PROPERTYSHEETNAME.manage_changeProperties(R=
EQUEST)&quot;</FONT>
</P>

<P><FONT SIZE=3D2>for every property sheet you want to update. (Note =
that it is not edit but change that you should use.) You would have five =
of these, one for each property sheet. All attibutes in the property =
sheet matching a key from the REQUEST will be updated with the value =
from the REQUEST associated with the key.</FONT></P>

<P><FONT SIZE=3D2>I do this in a PythonScript, but it should work with =
dtml-call as well.</FONT>
</P>

<P><FONT SIZE=3D2>Also, unless you're changing the default catalog of a =
(presumably) CatalogAware object, with manage_editCataloger, I don't =
think you need to reindex. And if you do, it should go after you change =
the properties. And it should probably be a plain index, since it never =
was in that catalog in the first place. At least that's what work for =
me.</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>--jcc</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>(yay =
objects!)</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C0FB60.454BFFEC--