Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
413d6481
Commit
413d6481
authored
Apr 27, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now use exported sql_quote__ function to quote strings.
parent
ec2687e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+7
-4
lib/python/Shared/DC/ZRDB/sqltest.py
lib/python/Shared/DC/ZRDB/sqltest.py
+6
-3
lib/python/Shared/DC/ZRDB/sqlvar.py
lib/python/Shared/DC/ZRDB/sqlvar.py
+9
-4
No files found.
lib/python/Shared/DC/ZRDB/DA.py
View file @
413d6481
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.4
3 1998/04/27 18:56:13
jim Exp $'''
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
$Id: DA.py,v 1.4
4 1998/04/27 18:59:56
jim Exp $'''
__version__
=
'$Revision: 1.4
4
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
...
...
@@ -270,7 +270,7 @@ class DA(
argdata
=
self
.
_argdata
(
REQUEST
)
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_quote'
]
=
dbc
.
sql_quote__
argdata
[
'sql_quote
__
'
]
=
dbc
.
sql_quote__
query
=
apply
(
self
.
template
,
(
p
,),
argdata
)
if
src__
:
return
query
...
...
@@ -311,7 +311,7 @@ class DA(
else
:
p
=
None
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_quote'
]
=
dbc
.
sql_quote__
argdata
[
'sql_quote
__
'
]
=
dbc
.
sql_quote__
query
=
apply
(
self
.
template
,(
p
,),
argdata
)
if
self
.
cache_time_
:
...
...
@@ -438,6 +438,9 @@ def getBrain(self,
##############################################################################
#
# $Log: DA.py,v $
# Revision 1.44 1998/04/27 18:59:56 jim
# Now use exported sql_quote__ function to quote strings.
#
# Revision 1.43 1998/04/27 18:56:13 jim
# Now export an sql_quote function that is used by sqlvar and sqltest
# to quote strings.
...
...
lib/python/Shared/DC/ZRDB/sqltest.py
View file @
413d6481
...
...
@@ -46,7 +46,7 @@
'and' or 'or' tag, otherwise, no text is inserted.
'''
__rcs_id__
=
'$Id: sqltest.py,v 1.
4 1998/04/27 18:57:23
jim Exp $'
__rcs_id__
=
'$Id: sqltest.py,v 1.
5 1998/04/27 18:58:39
jim Exp $'
############################################################################
# Copyright
...
...
@@ -56,7 +56,7 @@ __rcs_id__='$Id: sqltest.py,v 1.4 1998/04/27 18:57:23 jim Exp $'
# rights reserved.
#
############################################################################
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
from
DocumentTemplate.DT_Util
import
*
...
...
@@ -118,7 +118,7 @@ class SQLTest:
'Invalid floating-point value for <em>%s</em>'
%
name
)
else
:
v
=
str
(
v
)
v
=
md
.
getitem
(
'sql_quote'
,
0
)(
v
)
v
=
md
.
getitem
(
'sql_quote
__
'
,
0
)(
v
)
#if find(v,"\'") >= 0: v=join(split(v,"\'"),"''")
#v="'%s'" % v
...
...
@@ -140,6 +140,9 @@ valid_type={'int':1, 'float':1, 'string':1, 'nb': 1}.has_key
############################################################################
# $Log: sqltest.py,v $
# Revision 1.5 1998/04/27 18:58:39 jim
# Now use exported sql_quote__ function to quote strings.
#
# Revision 1.4 1998/04/27 18:57:23 jim
# Now use exported sql quote function to quote strings.
#
...
...
lib/python/Shared/DC/ZRDB/sqlvar.py
View file @
413d6481
...
...
@@ -38,7 +38,7 @@
however, if x is ommitted or an empty string, then the value
inserted is 'null'.
'''
__rcs_id__
=
'$Id: sqlvar.py,v 1.
1 1998/03/17 19:31:22
jim Exp $'
__rcs_id__
=
'$Id: sqlvar.py,v 1.
2 1998/04/27 18:58:14
jim Exp $'
############################################################################
# Copyright
...
...
@@ -48,7 +48,7 @@ __rcs_id__='$Id: sqlvar.py,v 1.1 1998/03/17 19:31:22 jim Exp $'
# rights reserved.
#
############################################################################
__version__
=
'$Revision: 1.
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
from
DocumentTemplate.DT_Util
import
*
from
string
import
find
,
split
,
join
,
atoi
,
atof
...
...
@@ -98,8 +98,10 @@ class SQLVar:
if
not
v
and
t
==
'nb'
:
raise
ValueError
,
(
'Invalid empty string value for <em>%s</em>'
%
name
)
if
find
(
v
,
"
\
'
"
)
>=
0
:
v
=
join
(
split
(
v
,
"
\
'
"
),
"''"
)
v
=
"'%s'"
%
v
v
=
md
.
getitem
(
'sql_quote__'
,
0
)(
v
)
#if find(v,"\'") >= 0: v=join(split(v,"\'"),"''")
#v="'%s'" % v
return
v
...
...
@@ -109,6 +111,9 @@ valid_type={'int':1, 'float':1, 'string':1, 'nb': 1}.has_key
############################################################################
# $Log: sqlvar.py,v $
# Revision 1.2 1998/04/27 18:58:14 jim
# Now use exported sql_quote__ function to quote strings.
#
# Revision 1.1 1998/03/17 19:31:22 jim
# added new sql tags
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment