[Zope] Object ID and Property confusion
Phil Harris
phil.harris@zope.co.uk
Wed, 9 Feb 2000 16:18:50 -0000
How about (untested)
<table>
<tr><th>ID</th><th>Property</th></tr>
<dtml-in "objectItems(['myObj'])">
<tr><td><dtml-var sequence-item></td><td><dtml-var myProp></td></tr>
</dtml-in>
</table>
You might have to change sequence-item to sequence-key, maybe?!?
Also, this would probably only be usable from within a DTML Method?!?
HTH
Phil
phil.harris@zope.co.uk
| -----Original Message-----
| From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of David
| Salgado
| Sent: Wednesday, February 09, 2000 3:03 PM
| To: 'zope@zope.org'
| Subject: [Zope] Object ID and Property confusion
|
|
| Hi All
|
| I'm sure this is a dumb question, but I haven't been able to
| figure it out
| yet...
|
| If I have a bunch of objects of type 'myObj' in a folder, then I can do
| something like;
|
| <dtml-in "objectIds('myObj')>
| <dtml-var sequence-item><br>
| </dtml-in>
|
| ...to display a list of all the ids of my 'myObj' objects in the
| folder - so
| far, so good.
|
| Now, each of the 'myObj' instances has a property 'myProp', which I'm
| interested in. So I can do this;
|
| <dtml-in "objectValues('myObj')">
| <dtml-var myProp><br>
| </dtml-in>
|
| ...to display a list of all the 'myProp' values of the 'myObj' objects.
|
| What I want to do is display a table where column one contains
| the id of the
| object, and column two contains the 'myProp' value. From a brief
| look at the
| source of "lib/python/OFS/ObjectManager.py" it looks as if the
| 'objectItems()' method might do something like what I want, but I haven't
| been able to get it to do what I want.
|
| Any ideas would be gratefully received!
|
| TIA
| David
|
|
| _______________________________________________
| Zope maillist - Zope@zope.org
| http://lists.zope.org/mailman/listinfo/zope
| ** No cross posts or HTML encoding! **
| (Related lists -
| http://lists.zope.org/mailman/listinfo/zope-announce
| http://lists.zope.org/mailman/listinfo/zope-dev )
|