|
|
Display All ZSQL Methods
Submitted by: pup
Last Edited: 2001-07-09
Category: ZSQL and SQL DA
|
Average rating is:
4.75 out of 5
|
(4 ratings) |
|
Description:
If you work w/a SQL-database driven site, you probably, like me,
have lots of ZSQL methods around, and are always turning caching
on and off, updating methods, etc.
This recipe prints all of your ZSQL methods on one page, with
the SQL code, and the advanced properties.
|
Source (Text):
<dtml-in "ZopeFind(restrictedTraverse(['']), obj_metatypes=['Z SQL Method'], search_sub=1)">
<h2>&dtml.-id; (&dtml.-title_or_id;)</h2>
<p><i><dtml-var absolute_url></i></p>
<blockquote><pre><dtml-var "template"></pre></blockquote>
<b>Max Rows:</b> <dtml-var "max_rows_"> /
<b>Max Cache:</b> <dtml-var "max_cache_"> /
<b>Cache Time:</b> <dtml-var "cache_time_"> /
<b>Class:</b> <dtml-var "class_name_"> /
<b>Class File:</b> <dtml-var "class_file_"> /
<b>Direct:</b> <dtml-var "allow_simple_one_argument_traversal">
</dtml-in>
|
Explanation:
restrictedTraverse( ) gets us the root object.
The methods "max_rows_", "template", etc. are the properties
of a ZSQL method.
|
Comments:
allow_simple_one_argument_traversal ?? by peterbe - 2001-07-06 |
What does the allow_simple_one_argument_traversal do? Is it a Z SQL Method property? |
|
|
Re: allow_simple_one_argument_traversal ?? by drees - 2001-07-06 |
It's the 'Allow "simple" direct traversal' property from the advanced tab |
|
|
using VirtualRootPhysicalPath by runyaga - 2001-07-07 |
this is a Script (Python) that returns objects that are under folders that have an attribute called published which is true.
pub = []
for folder in context.ZopeFind(context.restrictedTraverse(context.REQUEST.VirtualRootPhysicalPath), obj_metatypes=('Folder',), search_sub=1):
if hasattr(folder, 'published') and folder.published:
pub.append(folder.absolute_url())
pub.append(folder)
return pub
|
|
|
|
|
|