[Zope] referencing objects returned by z-catalog

Ben Avery ben@thesite.org.uk
Mon, 1 Jul 2002 17:55:23 +0100


Hi,

I'm having difficulty with the syntax needed to access the objects in the
results object returned by a z-catalog.

I'm using the dtml-calendar tag to give a calendar display of objects, which
have a date field.
I have 3 objects of a product called calendar_event, which has a text
property notes, and string field event_date.
I have a z-catalog called ce_catalog, which indexes these, but without the
notes field in the metadata - it's a large text field, so I don't want to
bring it back in every object referred to in a search result.

I try to call it with the following dtml:

<dtml-calendar>
<dtml-let year="date.year()"
          month="date.month()"
          day="date.day()"
          key="'%.4d-%.2d-%.2d' % (year,month,day)">
<dtml-in "ce_catalog({'event_date':key})">

<dtml-var expr="_['sequence-item'].notes">

</dtml-in>
</dtml-let>
</dtml-calendar>


but I get an attribute error - error value: notes.

if I replace the sequence-item dtml-var tag with <dtml-var
expr="_['sequence-key']"> this gives me the object ids.
and if I just call the object directly by id, e.g. <dtml-var
expr="ce_1.notes">, this gives me the value I'm after.

what am I doing wrong?


Ben Avery