manage_addProperty(...) failure on DTMLDocuments
Hi all: This is all on Zope-2.6.1 binary install on Linux. It seems that manage_addProperty() is not working propperly when indirectly applied to an instance of a DTMLDocument (case "A" below) whilst it works fine when an explicit instance od the DTMLDocument is used (case "B"). Having the following structure: root- folderA Working Example "A": <dtml-call "REQUEST.set('item',REQUEST.field1)"> <dtml-with "folderA.manage_addProduct['OFSP'].manage_addDTMLDocument(item, nombre)"> <dtml-call "folderA[item].propertysheets.manage_addProperty('costo_frec', costo_frec, 'string', REQUEST=None)"> </dtml-with> Troubled Example "B": <dtml-call "REQUEST.set('item',REQUEST.field1)"> <dtml-with "manage_addProduct['OFSP'].manage_addDTMLDocument(item, nombre)"> <dtml-call "REQUEST.item.propertysheets.manage_addProperty('costo_frec', costo_frec, 'string', REQUEST=None)"> </dtml-with> Every time in case "A", the outcome is the same: Error Type: AttributeError Error Value: propertysheets Traceback (innermost last): * Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module OFS.DTMLMethod, line 126, in __call__ * Module DocumentTemplate.DT_String, line 474, in __call__ * Module DocumentTemplate.DT_With, line 76, in render * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: None * Module <string>, line 2, in f AttributeError: propertysheets manage_addProperty works fine if a "File" is the object added instead of a DTMLDocument. Has anyone encountered this behavior. I believe it is referenced in the collector as issue # 444, (not sure tough). Comments are welcome, thanks in advance. Felipe Barousse
Felipe Barousse Boué wrote at 2003-4-4 18:50 -0600:
... Troubled Example "B":
<dtml-call "REQUEST.set('item',REQUEST.field1)"> <dtml-with "manage_addProduct['OFSP'].manage_addDTMLDocument(item, nombre)"> <dtml-call "REQUEST.item.propertysheets.manage_addProperty('costo_frec', costo_frec, 'string', REQUEST=None)"> </dtml-with>
Every time in case "A", the outcome is the same:
Error Type: AttributeError Error Value: propertysheets
You seem to confuse "A" and "B" :-) "REQUEST.item" is probably a string and a string does not have an attribute "propertysheets". Omit it altogether. Use: <dtml-call "manage_addProperty(...)"> By the way, a DTML Document does not have a "propertysheets", either. Therefore, I removed it above. Dieter
participants (2)
-
Dieter Maurer -
Felipe Barousse Boué