[Zope] Pluggable brains and the record class
Etienne Labuschagne
ELabuschagne@gims.com
Thu, 22 Aug 2002 17:10:30 +0200
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C249EE.0E03A840
Content-Type: text/plain;
charset="iso-8859-1"
Hi there,
All the examples I find show how to use pluggable brains IF you already know
the field names you are going to use - I don't and want to discover them in
run-time.
I know the records object has a names() method, but that doesn't help,
because the single record object doesn't know about the records object. I
want to write a pluggable brains class that takes all the fields and values
and wraps them in an XML string, now I know that I can write a method that
operates on the records object, but hoped I could use pluggable brains for
this.
It seems as if the record object is a list/dict like object (I can both use
self[0] or self.fieldName - but there is no keys() equivalent and I have
also tried dir, __dict__ on all the base classes, but to no avail).
Thanks
Etienne.
------_=_NextPart_001_01C249EE.0E03A840
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 =
5.5.2653.12">
<TITLE>Pluggable brains and the record class</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Hi there,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">All the examples I find show how to =
use pluggable brains IF you already know the field names you are going =
to use - I don't and want to discover them in run-time.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I know the records object has a =
names() method, but that doesn't help, because the single record object =
doesn't know about the records object. I want to write a =
pluggable brains class that takes all the fields and values and wraps =
them in an XML string, now I know that I can write a method that =
operates on the records object, but hoped I could use pluggable brains =
for this.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">It seems as if the record object is a =
list/dict like object (I can both use self[0] or self.fieldName - but =
there is no keys() equivalent and I have also tried dir, __dict__ on =
all the base classes, but to no avail).</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Etienne.</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C249EE.0E03A840--