[Zope] problems with news item properties

martin f krafft madduck at madduck.net
Tue Aug 26 21:34:05 EDT 2003


I am sending this to the general Zope list because I think this is
not really CMF-specific even though it uses a type from CMFDefault:
The News Item.

I have a macro that does pretty much the standard news box thing
(abbreviated):

  <metal:block define-macro="box"
    tal:define="results python:request.get('news',
      here.portal_catalog.searchResults( ... ));:>

        <tal:block repeat="obj results">

          <span tal:replace="python:test(obj.Title, obj.Title, obj.id)" />
          <span tal:replace="python:here.toPortalTime(obj.modified)" />
          <span tal:replace="structure obj/description" />
          <span tal:replace="structure obj/CookedBody" />

        </tal:block>

  </metal:block>

This macro is used by a template, which is used by a document to
render itself. It works, but mostly doesn't.

I can see ZCatalog returning a <mybrain instance> for each of the
results. However, if I then try to use these mybrains instances the
way I see e.g. Plone do it (the above is pretty much copied from
Plone), it does weird things.

The two news items I have created for testing purposes are named
"First" and "Second", and they both have different descriptions and
body texts.

When I render the document (which uses a macro that uses the above
macro), obj.Title seems to be "News Item" for both items, the
description is empty, and CookedBody outputs the CookedBody of the
document I am calling ('template') rather than the one of the
object. However, looking at CMFDefault/NewsItem.py, News Item does
sport 'description' and 'CookedBody', which is verified by looking
at the Plone ZPTs using it that way.

What is going on?

The page in question is at http://tokyolectures.org, but I guess
that doesn't really help a lot.

Thanks,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
 
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
 
"montag, why do you burn books?"
"it's a job like any other, pay is good and there is a lot of variety."
                                                -- ray bradbury (f451)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.zope.org/pipermail/zope/attachments/20030826/6996d356/attachment.bin


More information about the Zope mailing list