Commit 7a65f559 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Pass query_table correctly in buildSQLQuery.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1413 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e01d5b9
...@@ -26,7 +26,7 @@ from DocumentTemplate.DT_Util import InstanceDict, TemplateDict ...@@ -26,7 +26,7 @@ from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
from DocumentTemplate.DT_Util import Eval from DocumentTemplate.DT_Util import Eval
from AccessControl.Permission import name_trans from AccessControl.Permission import name_trans
from SQLCatalog import Catalog, CatalogError from SQLCatalog import Catalog, CatalogError
from AccessControl import getSecurityManager from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.DTML import RestrictedDTML from AccessControl.DTML import RestrictedDTML
import string, urllib, os, sys, time, types import string, urllib, os, sys, time, types
...@@ -75,6 +75,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -75,6 +75,7 @@ class ZCatalog(Folder, Persistent, Implicit):
meta_type = "ZSQLCatalog" meta_type = "ZSQLCatalog"
icon='misc_/ZCatalog/ZCatalog.gif' icon='misc_/ZCatalog/ZCatalog.gif'
security = ClassSecurityInfo()
manage_options = ( manage_options = (
{'label': 'Contents', # TAB: Contents {'label': 'Contents', # TAB: Contents
...@@ -376,7 +377,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -376,7 +377,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if REQUEST and RESPONSE: if REQUEST and RESPONSE:
RESPONSE.redirect(URL1 + '/manage_catalogAdvanced?manage_tabs_message=Catalog%20Cleared') RESPONSE.redirect(URL1 + '/manage_catalogAdvanced?manage_tabs_message=Catalog%20Cleared')
def manage_catalogCreateTables(self, REQUEST=None, RESPONSE=None, URL1=None): def manage_catalogCreateTables(self, REQUEST=None, RESPONSE=None, URL1=None):
""" creates the tables required for cataging objects """ """ creates the tables required for cataging objects """
self._catalog.createTables() self._catalog.createTables()
...@@ -443,7 +444,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -443,7 +444,7 @@ class ZCatalog(Folder, Persistent, Implicit):
Allocates a new uid value. Allocates a new uid value.
""" """
return self._catalog.newUid() return self._catalog.newUid()
def catalog_object(self, obj, uid=None, idxs=[], is_object_moved=0): def catalog_object(self, obj, uid=None, idxs=[], is_object_moved=0):
""" wrapper around catalog """ """ wrapper around catalog """
...@@ -481,7 +482,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -481,7 +482,7 @@ class ZCatalog(Folder, Persistent, Implicit):
def hasPath(self, path): def hasPath(self, path):
""" """
Checks if path is catalogued Checks if path is catalogued
""" """
return self._catalog.hasPath(path) return self._catalog.hasPath(path)
...@@ -568,6 +569,14 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -568,6 +569,14 @@ class ZCatalog(Folder, Persistent, Implicit):
def getColumnIds(self): def getColumnIds(self):
return self._catalog.getColumnIds() return self._catalog.getColumnIds()
security.declarePublic('buildSQLQuery')
def buildSQLQuery(self, REQUEST=None, query_table=None, **kw):
"""
Build a SQL query from keywords.
If query_table is specified, it is used as the table name instead of 'catalog'.
"""
return self._catalog.buildSQLQuery(REQUEST=REQUEST, query_table=query_table, **kw)
def searchResults(self, REQUEST=None, used=None, **kw): def searchResults(self, REQUEST=None, used=None, **kw):
""" """
Search the catalog according to the ZTables search interface. Search the catalog according to the ZTables search interface.
...@@ -857,7 +866,7 @@ def mtime_match(ob, t, q, fn=hasattr): ...@@ -857,7 +866,7 @@ def mtime_match(ob, t, q, fn=hasattr):
def role_match(ob, permission, roles, lt=type([]), tt=type(())): def role_match(ob, permission, roles, lt=type([]), tt=type(())):
pr=[] pr=[]
fn=pr.append fn=pr.append
while 1: while 1:
if hasattr(ob, permission): if hasattr(ob, permission):
p=getattr(ob, permission) p=getattr(ob, permission)
......
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