NameError obwohl das Objekt angezeigt wird?
Hartmut Goebel <[email protected]>
| Newsgroups | gmane.comp.web.zope.german |
|---|---|
| Organization | Goebel Consult |
| Message-ID | <[email protected]> |
Hallo,
ich habe einen sehr eigenartigen Fehler: Unten stehendes Snippet (eine
Variante von Plones newsitem_view) funktioniert wie gewünscht. Wenn ein
Bild vorhanden ist, dann wird es angezeigt. (Ebenso der Text, das habe
ich hier weg gelassen.)
<div class="zettel"
tal:define="object nocall:object | nocall:here;
text python:object.CookedBody(stx_level=2);"
tal:attributes="class string:zettel ${object/getBackground};">
<img tal:replace="structure python: object.tag(scale='thumb')"
src="" alt=""
tal:condition="object/image_thumb"/>
</div>
Nun möchte ich das Image nur anzeigen, wenn ${object/getBackground}
einen bestimmten Wert hat. Wenn ich die condition ändere, bekomme ich
aber plötzliche einen "NameError: 'object' not defined". Ich habe auch
mit PathExprs herumgespielt: gleiches Ergebnis.
tal:condition="python:object.getBackground()=='photo' and
object.image_mini"
Ich bin mit meinem Latein am Ende. Woran kann das liegen?
--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP
Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de
Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de
_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
smime.p7s
(application/pkcs7-signature, 4.6 KB) - not displayed