Oh, to follow up on my last post about turning an object to a string without leaving DTML, I have tried: <!--#var "str(_['ZopeTime'])"--> <!--#var "str(ZopeTime)"--> All help welcome! Jason Spisak webmaster@mtear.com
At 06:01 PM 3/29/99 -0500, Jason Spisak wrote:
Oh, to follow up on my last post about turning an object to a string without leaving DTML, I have tried:
<!--#var "str(_['ZopeTime'])"--> <!--#var "str(ZopeTime)"-->
I suggest: <!--#var "_.str(_.int(ZopeTime().timeTime()))"--> This basically means return a string representation of the integer truncation of the current time in ticks. -Amos P.S. in general using a var tag coerces an object into a string in one way or another. However, I include the _.str above since I assume that you will be passing this value to some other method, not just including it in a Document.
On Mon, 29 Mar 1999, Jason Spisak wrote:
Oh, to follow up on my last post about turning an object to a string without leaving DTML, I have tried:
<!--#var "str(_['ZopeTime'])"--> <!--#var "str(ZopeTime)"-->
All help welcome!
<!--# var "_.str(ZopeTime())"--> will return a string representation of the object. Alternatively you can generate unique object ids by adding a counter property to your containing folder (or root folder) and modify it everytime you generate a new object. For instance:: <!--# call "manage_addFolder(unique_id,unique_id,0,0,REQUEST)"--> <!--# call "manage_changeProperties(counter=counter+1)"--> <!--# call "manage_changeProperties(unique_id='MyFolder'+_.str(counter))"--> Pavlos
Pavlos: I had forgotten about the recent addition of the counter object to our arsenal of Zopeist tools. Shame on me. Thanks for the heads-up! Jason Spisak webmaster@mtear.com
On Mon, 29 Mar 1999, Jason Spisak wrote:
Oh, to follow up on my last post about turning an object to a string without leaving DTML, I have tried:
<!--#var "str(_['ZopeTime'])"--> <!--#var "str(ZopeTime)"-->
All help welcome!
<!--# var "_.str(ZopeTime())"--> will return a string representation of the object.
Alternatively you can generate unique object ids by adding a counter property to your containing folder (or root folder) and modify it everytime you generate a new object. For instance::
<!--# call "manage_addFolder(unique_id,unique_id,0,0,REQUEST)"--> <!--# call "manage_changeProperties(counter=counter+1)"--> <!--# call "manage_changeProperties(unique_id='MyFolder'+_.str(counter))"-->
Pavlos
-- Jason Spisak webmaster@mtear.com
Sorry Pavlos, I re-read you mail this morning and I realized you were talking about a property of the root (or a globally accesable) folder which you increment. Shame on me twice. :-) Jason Spisak webmaster@mtear.com
participants (3)
-
Amos Latteier -
Jason Spisak -
Pavlos Christoforou