[Zope] Mass update of a ZClass property?
Satheesh Babu
sbabu@tnc.org
Mon, 18 Jun 2001 12:59:25 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C0F7F6.80407FA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi,
I've a ZClass that defines an object of type X. In a folder there are
around 100 X objects. Now one of the properties of the ZClass is a
selection, drawn from a property "Category" which is of the type lines. The
values are
['Music','Software','Book']
Now, there is a requirement that 'Software' needs to be changed to 'CD'. How
do I change that in the 100 X objects, that have 'Software' category, in
one shot?
Calling manage_editProperties in a loop for 100 objects should work. But
this method needs REQUEST to be passed through. If I just set a REQUEST for
"Category" but that erases other properties of the object :-( So, I suppose
I've to load all properties for each object into REQUEST, then change
"Category" to CD if it is 'Software' and then call manage_editProperties.
Well, I tried playing with property_sheets.myproperty.propertyItems , with
not much luck.
Am I doing it in a round about way? Any easier solutions? I really miss SQL
here ;-(
V. Satheesh Babu http://vsbabu.csoft.net
------=_NextPart_000_0007_01C0F7F6.80407FA0
Content-Type: text/x-vcard;
name="Satheesh Babu.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Satheesh Babu.vcf"
BEGIN:VCARD
VERSION:2.1
N:Babu;Satheesh;;Mr
FN:Satheesh Babu
NICKNAME:Babu
ORG:The Nature Conservancy;Information Systems
TITLE:Sr. Web Programmer Analyst III
TEL;WORK;VOICE:703-841-5348
TEL;HOME;VOICE:703-534-6940
ADR;WORK:;Home Office;;Arlington;VA;22044;USA
LABEL;WORK;ENCODING=3DQUOTED-PRINTABLE:Home Office=3D0D=3D0AArlington, =
VA 22044=3D0D=3D0AUSA
ADR;HOME:;;6166 Leesburg Pike, #D506;Falls Church;VA;22044;USA
LABEL;HOME;ENCODING=3DQUOTED-PRINTABLE:6166 Leesburg Pike, =
#D506=3D0D=3D0AFalls Church, VA 22044=3D0D=3D0AUSA
URL;HOME:http://vsbabu.csoft.net
URL;WORK:http://nature.org
EMAIL;PREF;INTERNET:sbabu@tnc.org
REV:20010319T201937Z
END:VCARD
------=_NextPart_000_0007_01C0F7F6.80407FA0--