[Zope-dev] Object to string
Pavlos Christoforou
pavlos@gaaros.msrc.sunysb.edu
Mon, 29 Mar 1999 21:59:31 -0500 (EST)
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