Commit 61e0bff6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify to remove 'Giving where_expression a string value is deprecated.' logs.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28383 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 878e5bfd
......@@ -49,6 +49,7 @@ from Products.ERP5Type.Cache import getReadOnlyTransactionCache, DEFAULT_CACHE_S
from Products.ERP5.Document.Url import UrlMixIn
from Products.ERP5.Tool.ContributionTool import MAX_REPEAT
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ZSQLCatalog.SQLCatalog import SQLQuery
from AccessControl import Unauthorized
import zope.interface
import string
......@@ -852,7 +853,7 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna
# Find all document with same (reference, version, language)
kw = dict(portal_type=self.getPortalDocumentTypeList(),
reference=self.getReference(),
where_expression="validation_state NOT IN ('cancelled', 'deleted')")
where_expression=SQLQuery("validation_state NOT IN ('cancelled', 'deleted')"))
if self.getVersion(): kw['version'] = self.getVersion()
if self.getLanguage(): kw['language'] = self.getLanguage()
document_list = catalog.unrestrictedSearchResults(**kw)
......
......@@ -40,6 +40,7 @@ from Products.ERP5Type.Document import newTempBase
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.Cache import getReadOnlyTransactionCache, enableReadOnlyTransactionCache, disableReadOnlyTransactionCache
from Products.ZSQLCatalog.SQLCatalog import SQLQuery
from Globals import PersistentMapping
from zLOG import LOG
......@@ -287,7 +288,7 @@ class Predicate(XMLObject, Folder):
multimembership_select_list)
# Now merge identity and membership criteria
catalog_kw['where_expression'] = sql_text
catalog_kw['where_expression'] = SQLQuery(sql_text)
sql_query = portal_catalog.buildSQLQuery(**catalog_kw)
for alias, table in sql_query['from_table_list']:
if from_table_dict.has_key(alias):
......
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