[warning: newbie] o I would like to see all the objects in the `_' namespace how can I do that? o In general, if I have an object can I loop though it's elements like `for i in obj: print i' or someting? o Is there a `dump()' function to display an object as-is? TIA -- CIMPOESU Teodor, Web Programmer @ DIGICOM S.A. Bucharest, Romania @ Internet, site development @ teo@digiro.net , +(401)-330.47.28 official home page ~ http://www.digiro.net/ Internet web page ~ http://internet.digiro.net/
----- Original Message ----- From: Teodor Cimpoesu <teo@digiro.net> To: <zope@zope.org> Sent: Thursday, December 02, 1999 10:28 PM Subject: [Zope] how to [Q] | [warning: newbie] | o I would like to see all the objects in the `_' namespace | how can I do that? Try this (untested): <dtml-in "_"> <dtml-var sequence-key> = <dtml-var sequence-item> <br> </dtml-in> | o In general, if I have an object can I loop though it's elements | like `for i in obj: print i' or someting? <dtml-in obj> <dtml-var sequence-item> <br> </dtml-in> | o Is there a `dump()' function to display an object as-is? In Python you can uses backquotes (`) around the object. In DTML:- <dtml-var expr="`obj`"> The object may be printed inside <...> so you may not see it on the html page. Look at the source. | | TIA | -- | CIMPOESU Teodor, Web Programmer | | @ DIGICOM S.A. Bucharest, Romania | @ Internet, site development | @ teo@digiro.net , +(401)-330.47.28 | | official home page ~ http://www.digiro.net/ | Internet web page ~ http://internet.digiro.net/ | | _______________________________________________ | 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 ) |
Shalabh Chaturvedi wrote:
Try this (untested): <dtml-in "_"> <dtml-var sequence-key> = <dtml-var sequence-item> <br> </dtml-in>
This doesn't work :( I get Error Type: TypeError Error Value: argument 1: expected read-only character buffer, int found
| o In general, if I have an object can I loop though it's elements | like `for i in obj: print i' or someting?
<dtml-in obj> <dtml-var sequence-item> <br> </dtml-in>
This won't work either (I tried w/ REQUEST and got `unsliceable object')
| o Is there a `dump()' function to display an object as-is? In Python you can uses backquotes (`) around the object. In DTML:-
<dtml-var expr="`obj`"> The object may be printed inside <...> so you may not see it on the html page. Look at the source.
Now this is the cool one :-) it works, and , to my surprise, <dtml-var expr="`REQUEST`"> generates a nice table not a hidden thingie. Thank you for taking your time, -- CIMPOESU Teodor, Web Programmer @ DIGICOM S.A. Bucharest, Romania @ Internet, site development @ teo@digiro.net , +(401)-330.47.28 official home page ~ http://www.digiro.net/ Internet web page ~ http://internet.digiro.net/
participants (2)
-
Shalabh Chaturvedi -
Teodor Cimpoesu