<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:10
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>sort_on
query
parent_uid</params>
<dtml-if sort_on>
<dtml-if query>
SELECT DISTINCT catalog.* FROM catalog, category, roles_and_users WHERE catalog.uid=category.uid AND catalog.uid=roles_and_users.uid AND <dtml-var query> AND <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> ORDER BY <dtml-var sort_on>
<dtml-else>
SELECT * FROM catalog WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> ORDER BY <dtml-var sort_on>
</dtml-if>
<dtml-else>
<dtml-if query>
SELECT DISTINCT catalog.* FROM catalog, category, roles_and_users WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> AND catalog.uid=category.uid AND catalog.uid=roles_and_users.uid AND <dtml-var query>
<dtml-else>
SELECT * FROM catalog WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int>
</dtml-if>
</dtml-if>