20 Jun
2002
20 Jun
'02
7:54 p.m.
Joachim Schmitz writes:
I have a python-script getArtikel, which return items from a ZPatterns-Rack, like so:
item=context.getItem("theItemId") return item
this works fine, now I want to override some of the attributes of the item:
item=context.getItem("theItemId") setattr(item.text,item.text_english) # the attribute text_english exists return item
but that results in an error: attributeless object assign or del. I would expect a TypeError, as "setattr" has three parameters: object, attribute name and value. Try:
setattr(item,'text',item.text_english) Dieter