version 1.41, 2004/10/19 11:24:12
|
version 1.42, 2004/10/21 15:36:53
|
Line 13 from Products.PageTemplates.PageTemplate
|
Line 13 from Products.PageTemplates.PageTemplate
|
from Products.ZSQLMethods.SQL import SQLConnectionIDs |
from Products.ZSQLMethods.SQL import SQLConnectionIDs |
import Shared.DC.ZRDB.DA |
import Shared.DC.ZRDB.DA |
|
|
|
def analyseIntSearch(word): |
|
#analyse integer searches |
|
|
|
splitted=word.split("-") |
|
print splitted |
|
if splitted[0]=="": |
|
return "< "+splitted[1] |
|
|
|
if splitted[1]=='': |
|
return "> "+splitted[0] |
|
else: |
|
return "BETWEEN "+splitted[0]+" AND "+splitted[1] |
|
|
|
|
|
|
def sql_quote(v): |
def sql_quote(v): |
# quote dictionary |
# quote dictionary |
quote_dict = {"\'": "''", "\\": "\\\\"} |
quote_dict = {"\'": "''", "\\": "\\\\"} |
Line 661 class ZSQLExtendFolder(Folder,Persistent
|
Line 676 class ZSQLExtendFolder(Folder,Persistent
|
|
|
tmp=string.join(tmps,' AND ') |
tmp=string.join(tmps,' AND ') |
|
|
|
elif op=="numerical": |
|
term=analyseIntSearch(value) |
|
tmp=(name+" "+term) |
|
elif op=="one": |
|
tmps=[] |
|
for word in value.split(" "): |
|
tmps.append(name+" LIKE "+sql_quote("%"+word+"%")) |
|
|
|
tmp=string.join(tmps,' OR ') |
|
|
op="ct" |
op="ct" |
|
|
if (not tableExt) or (namealt.split('.')[0]==tableExt): |
if (not tableExt) or (namealt.split('.')[0]==tableExt): |
Line 786 class ZSQLExtendFolder(Folder,Persistent
|
Line 811 class ZSQLExtendFolder(Folder,Persistent
|
|
|
def nextLink(self,html,storename="foundCount"): |
def nextLink(self,html,storename="foundCount"): |
"""nextLink""" |
"""nextLink""" |
|
print self.REQUEST.SESSION[storename]['rangeSize'] |
try: |
try: |
limit=self.REQUEST.SESSION[storename]['rangeSize'] |
limit=self.REQUEST.SESSION[storename]['rangeSize'] |
if int(limit)==0 : |
if int(limit)==0 : |
Line 838 class ZSQLExtendFolder(Folder,Persistent
|
Line 864 class ZSQLExtendFolder(Folder,Persistent
|
|
|
def prevLink(self,html,storename="foundCount"): |
def prevLink(self,html,storename="foundCount"): |
"""prev link""" |
"""prev link""" |
|
|
try: |
try: |
limit=self.REQUEST.SESSION[storename]['rangeSize'] |
limit=self.REQUEST.SESSION[storename]['rangeSize'] |
if int(limit)==0 : |
if int(limit)==0 : |