(urgent) manage_changeProperties(data='new content') problem
This works: context.dtmldocument.manage_changeProperties(title='New Title') This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>') Please help. Peter
What would you expect the second one to do? ----- Original Message ----- From: "Peter Bengtsson" <mail@peterbe.com> To: <zope@zope.org> Sent: Tuesday, June 12, 2001 12:15 PM Subject: [Zope] (urgent) manage_changeProperties(data='new content') problem
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
Please help. Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I expect to change the content of the data property. You know, just like when you are editing DTML or something and you click "Save changes" for saving.
What would you expect the second one to do?
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
Please help. Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Actually, I think there is a bugreport about this filed by Martijn in the collector. :-( The upshot is that you can't store XMLish things inside of properties. It hasn't been resolved. ----- Original Message ----- From: "Peter Bengtsson" <mail@peterbe.com> To: "Chris McDonough" <chrism@digicool.com>; <zope@zope.org> Sent: Tuesday, June 12, 2001 12:43 PM Subject: Re: [Zope] (urgent) manage_changeProperties(data='new content') problem
I expect to change the content of the data property. You know, just like when you are editing DTML or something and you click "Save changes" for saving.
What would you expect the second one to do?
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
Please help. Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi,
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
this should work: context.dtmldocument.manage_changeProperties(data=hello) ... "no dtml inside dtml!" ... Robert
On 12 Jun 2001 18:15:18 +0200, Peter Bengtsson wrote:
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
This will make data be: <dtml-var hello> You can't put DTML in a python assignmetn and expect it to be evaluated. If hello is available in the local namespace, you could do: context.document.manage_changeProperties(data=hello) you _may_ need to make it ...(data=hello()) it depends on what hello is/does. Bill
I think he wants it to be the literal string '<dtml-var hello>' which should be legal, but isn't, IIRC. ----- Original Message ----- From: "Bill Anderson" <bill@libc.org> To: <zope@zope.org> Sent: Tuesday, June 12, 2001 1:34 PM Subject: Re: [Zope] (urgent) manage_changeProperties(data='new content')problem
On 12 Jun 2001 18:15:18 +0200, Peter Bengtsson wrote:
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
This will make data be: <dtml-var hello>
You can't put DTML in a python assignmetn and expect it to be evaluated.
If hello is available in the local namespace, you could do: context.document.manage_changeProperties(data=hello)
you _may_ need to make it ...(data=hello())
it depends on what hello is/does.
Bill
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Chris McDonough wrote:
I think he wants it to be the literal string '<dtml-var hello>' which should be legal, but isn't, IIRC.
Whoah! :-( How do you find out what you _can_ store in properties? I was planning to replace a proprietary data storange thang that smelled like properties to actually use properties, but there's no way I can do that if I have to worry about what I can and can't store in string properties :-S Anyone got any insights into why they behave like this? cheers, Chris
Chris Withers writes:
Chris McDonough wrote:
I think he wants it to be the literal string '<dtml-var hello>' which should be legal, but isn't, IIRC.
Whoah! :-(
How do you find out what you _can_ store in properties? Seems to be a bug.
Surely, you do not expect that all bugs are already documented ;-). Dieter
Perhaps this rings a bell? newdata="""<dtml-var standard_html_header> <h2><dtml-var title_or_id></h2> <p> This is the <dtml-var id> Document. </p> <dtml-var standard_html_footer>""" As conluded by Chris McDonough, there seems to be a bug with when this stringvariable looks XMLish. Perhaps this is because you must never be allowed to save false DTML syntax and that can cause problems. This can solve the problem: context.dtmldocument.manage_changeProperties(storyboardproperty=newdata) ----- Original Message ----- From: "Bill Anderson" <bill@libc.org> To: <zope@zope.org> Sent: Tuesday, June 12, 2001 7:34 PM Subject: Re: [Zope] (urgent) manage_changeProperties(data='new content')problem
On 12 Jun 2001 18:15:18 +0200, Peter Bengtsson wrote:
This works: context.dtmldocument.manage_changeProperties(title='New Title')
This does NOT work: context.dtmldocument.manage_changeProperties(data='<dtml-var hello>')
This will make data be: <dtml-var hello>
You can't put DTML in a python assignmetn and expect it to be evaluated.
If hello is available in the local namespace, you could do: context.document.manage_changeProperties(data=hello)
you _may_ need to make it ...(data=hello())
it depends on what hello is/does.
Bill
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (6)
-
Bill Anderson -
Chris McDonough -
Chris Withers -
Dieter Maurer -
Peter Bengtsson -
Robert Wohlfahrt