strange error with lines property
I have a DMTL-Document with lines property. in an external method I gather lines of text from a file, concatenate them into a long string with '\n' as line separator and manage_changeProperties() this string into the lines property of my document. now: everything works well (e.g. displaying the lines in my document), but if I go to the documents property page in zope I get the following error:
Error Type: InError Error Value: Strings are not allowed as input to the in tag.
Traceback (innermost last): File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 209, in publish_module File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/lib/zope/lib/python/Zope/__init__.py, line 199, in zpublisher_exception_hook (Object: l_1101_html) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 165, in publish File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 154, in mapply (Object: manage_propertiesForm) File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: manage_propertiesForm) File /usr/lib/zope/lib/python/App/special_dtml.py, line 120, in __call__ (Object: manage_propertiesForm) File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: manage_propertiesForm) File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 689, in renderwob (Object: propertyMap) File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 639, in renderwob (Object: getProperty(id)) InError: (see above) Is this a known error (as I still have to use B4...) or did I do something wrong? thanks, Heiko -- Heiko Stoermer MIG Augsburg
At 10:04 13/09/99 , Heiko Stoermer wrote:
I have a DMTL-Document with lines property. in an external method I gather lines of text from a file, concatenate them into a long string with '\n' as line separator and manage_changeProperties() this string into the lines property of my document. now: everything works well (e.g. displaying the lines in my document), but if I go to the documents property page in zope I get the following error:
Error Type: InError Error Value: Strings are not allowed as input to the in tag.
That is because internally, the lines are stored like a list, that's what the property type is for. Only for input on the properties form is it converted to \n delimited lines. When manage_ChangeProperties is called from the web, Zope has already marshalled the :lines property into a list, so your DTML code should hand it a list as well. All you have to do is leave out the concatenation. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (2)
-
Heiko Stoermer -
Martijn Pieters