[Fwd: RE: [Zope] conflict error]
Adam Warner
lists@consulting.net.nz
06 Nov 2001 00:31:24 +1300
Sorry Prabu I do not know the answer. I've forwarded your message to the
list. You should still supply the error message details.
Regards,
Adam
-----Forwarded Message-----
From: prabu <ajprabu@yahoo.com>
To: Adam Warner <lists@consulting.net.nz>
Subject: RE: [Zope] conflict error
Date: 05 Nov 2001 15:58:12 -0800
Tx Adam,
I ve used a python function replaceQuote(objectname) as a python script in
zope.
The content of the replaceQuote function is
ResString=''
UnfString=strParam
if not UnfString:
return(ResString)
UnfString_Len=len(UnfString)
UnfString_Cnt=0
while UnfString_Cnt < UnfString_Len:
Unf_Char=UnfString[UnfString_Cnt:UnfString_Cnt+1]
UnfString_Cnt=UnfString_Cnt+1
if Unf_Char=='\'':
ResString=ResString+'\\'+Unf_Char
elif Unf_Char=='\\':
ResString=ResString+'\\'+Unf_Char
elif Unf_Char=='\"':
ResString=ResString+'\\'+Unf_Char
else:
ResString=ResString+Unf_Char
return(ResString)
This function will replace the single quote('), double quote(") and slash(\)
to a set of character which is prefixed with slash(\).
I m calling this function as below whenver the objectname is accessed by a
ZSQL method. (Becoz ZSQL method raises a zope error if the object name is
inserted with special characters(',",\).)
<dtml-let Py_Product1="replaceQuote(Product1)">
<dtml-call "Insert_CSTable(Py_Product1)">
</dtml-let>
The problem is - I m calling this replaceQuote function often throughout the
page. Sometimes if more number of users are accessing the same page the
Conflict Error occur. Can I solve this problem anyway.
Prabu
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com