Commit c48485f4 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_web: Stop relying on portal_selections for SQL expression generation

parent c609f284
<dtml-let query="getattr(search_context, 'buildSQLQuery', portal_catalog.buildSQLQuery)(query=portal_catalog.getSecurityQuery(**kw), **kw)"
selection_domain="kw.get('selection_domain', None)"
selection_report="kw.get('selection_report', None)"
optimizer_switch_key_list="getOptimizerSwitchKeyList()">
<dtml-let
asQuery="getattr(search_context, 'asQuery', None)"
dummy="None if asQuery is None else kw.update({'websection_query': asQuery()})"
query="
buildSQLQuery(
security_query=getSecurityQuery(sql_catalog_id=getId(),
local_roles=kw.pop('local_roles', None)),
**kw
)
"
optimizer_switch_key_list="getOptimizerSwitchKeyList()"
>
<dtml-comment>
Currently, there is no other choice to implement this method as an SQL catalog until SQLCatalog
can support more features which are needed here. Once SQLCatalog supports those feature,
......@@ -39,24 +46,12 @@
<dtml-in prefix="table" expr="query['from_table_list']">
<dtml-var table_item> AS <dtml-var table_key>,
</dtml-in>
<dtml-if selection_domain>
<dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)">,
</dtml-if>
<dtml-if selection_report>
<dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)">,
</dtml-if>
versioning AS my_versioning
WHERE
my_versioning.uid = catalog.uid
<dtml-if "query['where_expression']">
AND <dtml-var "query['where_expression']">
</dtml-if>
<dtml-if selection_domain>
AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain)">
</dtml-if>
<dtml-if selection_report>
AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report)">
</dtml-if>
<dtml-if all_languages>
<dtml-else>
AND my_versioning.language IN (<dtml-sqlvar language type="string">, '')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment