Commit f4809d4e authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_web: Stop relying on portal_selections for SQL expression generation

parent ac67b032
<dtml-let query="getattr(search_context, 'buildSQLQuery', portal_catalog.buildSQLQuery)(query=portal_catalog.getSecurityQuery(**kw), **kw)" <dtml-let
selection_domain="kw.get('selection_domain', None)" asQuery="getattr(search_context, 'asQuery', None)"
selection_report="kw.get('selection_report', None)" dummy="None if asQuery is None else kw.update({'websection_query': asQuery()})"
optimizer_switch_key_list="getOptimizerSwitchKeyList()"> query="
buildSQLQuery(
security_query=getSecurityQuery(sql_catalog_id=getId(),
local_roles=kw.pop('local_roles', None)),
**kw
)
"
optimizer_switch_key_list="getOptimizerSwitchKeyList()"
>
<dtml-comment> <dtml-comment>
Currently, there is no other choice to implement this method as an SQL catalog until SQLCatalog 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, can support more features which are needed here. Once SQLCatalog supports those feature,
...@@ -39,24 +46,12 @@ ...@@ -39,24 +46,12 @@
<dtml-in prefix="table" expr="query['from_table_list']"> <dtml-in prefix="table" expr="query['from_table_list']">
<dtml-var table_item> AS <dtml-var table_key>, <dtml-var table_item> AS <dtml-var table_key>,
</dtml-in> </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 versioning AS my_versioning
WHERE WHERE
my_versioning.uid = catalog.uid my_versioning.uid = catalog.uid
<dtml-if "query['where_expression']"> <dtml-if "query['where_expression']">
AND <dtml-var "query['where_expression']"> AND <dtml-var "query['where_expression']">
</dtml-if> </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 strict_language> <dtml-if strict_language>
AND my_versioning.language IN (<dtml-sqlvar language type="string">, '') AND my_versioning.language IN (<dtml-sqlvar language type="string">, '')
</dtml-if> </dtml-if>
......
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