I have a very simple documentclass in very simple structure in method that should return the properties of the document: <dtml-call "REQUEST.set('tid', REQUEST.cookies['careermanid'])"> <dtml-with RESULTS> // RESULTS is a ZClass Object Manager <dtml-call "REQUEST.set('tmp', _.getitem(_['tid']))"> // tmp is a document with an id equal to the cookie <dtml-return "tmp.propertyIds"> </dtml-with> During the application i add properties to the document and want to display them with the above method. The Property ids does not get shown though. I've tried: <dtml-with tmp> <dtml-var propertyIds> </dtml-with> and also: <dtml-in "tmp.propertyIds"> <dtml-return sequence-item> </dtml-with> But no luck. How can this work? Roché
On Mon, 19 Jun 2000, RC Compaan wrote:
<dtml-call "REQUEST.set('tmp', _.getitem(_['tid']))"> // tmp is a document with an id equal to the cookie
1. Isn't it enough just to write _.getitem(tid)? 2. A shot in the dark: tmp is not a document, but its rendering. Try getitem(tid, 0)... Oleg. (All opinions are mine and not of my employer) ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
I have a very simple documentclass in very simple structure in method that should return the properties of the document:
<dtml-call "REQUEST.set('tid', REQUEST.cookies['careermanid'])"> <dtml-with RESULTS> // RESULTS is a ZClass Object Manager <dtml-call "REQUEST.set('tmp', _.getitem(_['tid']))"> // tmp is a document with an id equal to the cookie <dtml-return "tmp.propertyIds">
this line should read: <dtml-var "tmp.propertyIds()"> Two things going wrong: 1. the dtml-return tag is for DTML Methods that should just return something. You want dtml-var. 2. you call propertyIds in an expression (the line is shorthand for <dtml-var expr="tmp.propertyIds()"> - in that case you have to call it as a function.
</dtml-with>
During the application i add properties to the document and want to display them with the above method. The Property ids does not get shown though. I've tried: <dtml-with tmp> <dtml-var propertyIds> </dtml-with>
this should get you a list, like ['title', 'prop1, ...]
and also: <dtml-in "tmp.propertyIds"> <dtml-return sequence-item> </dtml-with>
this doesn't work for reasons outlined above. Rik
Thanks Rik it works. I've noticed in some cases that one puts empty brackets at the end of certain zope object methods. Is that there for methods that can take parameters? Roché
-----Original Message----- From: Rik Hoekstra [mailto:rik.hoekstra@inghist.nl] Sent: 19 June 2000 12:54 To: RC Compaan Cc: Zope Subject: Re: [Zope] PropertyIds
I have a very simple documentclass in very simple structure in
method that
should return the properties of the document:
<dtml-call "REQUEST.set('tid', REQUEST.cookies['careermanid'])"> <dtml-with RESULTS> // RESULTS is a ZClass Object Manager <dtml-call "REQUEST.set('tmp', _.getitem(_['tid']))"> // tmp is a document with an id equal to the cookie <dtml-return "tmp.propertyIds">
this line should read:
<dtml-var "tmp.propertyIds()">
Two things going wrong:
1. the dtml-return tag is for DTML Methods that should just return something. You want dtml-var. 2. you call propertyIds in an expression (the line is shorthand for <dtml-var expr="tmp.propertyIds()"> - in that case you have to call it as a function.
</dtml-with>
During the application i add properties to the document and want to display them with the above method. The Property ids does not get shown though. I've tried: <dtml-with tmp> <dtml-var propertyIds> </dtml-with>
this should get you a list, like ['title', 'prop1, ...]
and also: <dtml-in "tmp.propertyIds"> <dtml-return sequence-item> </dtml-with>
this doesn't work for reasons outlined above.
Rik
participants (3)
-
Oleg Broytmann -
RC Compaan -
Rik Hoekstra