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
dfd07748
Commit
dfd07748
authored
Apr 27, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now export an sql_quote function that is used by sqlvar and sqltest
to quote strings.
parent
b3a0e7c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
lib/python/Shared/DC/ZRDB/Connection.py
lib/python/Shared/DC/ZRDB/Connection.py
+7
-2
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+21
-7
No files found.
lib/python/Shared/DC/ZRDB/Connection.py
View file @
dfd07748
...
@@ -10,13 +10,14 @@
...
@@ -10,13 +10,14 @@
__doc__
=
'''Generic Database Connection Support
__doc__
=
'''Generic Database Connection Support
$Id: Connection.py,v 1.
9 1998/04/27 16:10:32
jim Exp $'''
$Id: Connection.py,v 1.
10 1998/04/27 18:56:29
jim Exp $'''
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
10
$'
[
11
:
-
2
]
import
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
,
Persistence
,
Acquisition
,
sys
import
Globals
,
OFS
.
SimpleItem
,
AccessControl
.
Role
,
Persistence
,
Acquisition
,
sys
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
App.Dialogs
import
MessageDialog
from
App.Dialogs
import
MessageDialog
from
Globals
import
HTMLFile
from
Globals
import
HTMLFile
from
string
import
find
,
join
,
split
class
Connection
(
class
Connection
(
Persistence
.
Persistent
,
Persistence
.
Persistent
,
...
@@ -145,6 +146,10 @@ class Connection(
...
@@ -145,6 +146,10 @@ class Connection(
##############################################################################
##############################################################################
#
#
# $Log: Connection.py,v $
# $Log: Connection.py,v $
# Revision 1.10 1998/04/27 18:56:29 jim
# Now export an sql_quote function that is used by sqlvar and sqltest
# to quote strings.
#
# Revision 1.9 1998/04/27 16:10:32 jim
# Revision 1.9 1998/04/27 16:10:32 jim
# *** empty log message ***
# *** empty log message ***
#
#
...
...
lib/python/Shared/DC/ZRDB/DA.py
View file @
dfd07748
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.4
2 1998/04/27 18:31:32
jim Exp $'''
$Id: DA.py,v 1.4
3 1998/04/27 18:56:13
jim Exp $'''
__version__
=
'$Revision: 1.4
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
...
@@ -251,8 +251,13 @@ class DA(
...
@@ -251,8 +251,13 @@ class DA(
else
:
else
:
if
hasattr
(
self
,
'REQUEST'
):
REQUEST
=
self
.
REQUEST
if
hasattr
(
self
,
'REQUEST'
):
REQUEST
=
self
.
REQUEST
else
:
REQUEST
=
{}
else
:
REQUEST
=
{}
try
:
DB__
=
getattr
(
self
,
self
.
connection_id
)()
try
:
dbc
=
getattr
(
self
,
self
.
connection_id
)
except
AttributeError
:
raise
AttributeError
,
(
"The database connection, <em>%s</em>, cannot be found."
)
try
:
DB__
=
dbc
()
except
:
raise
'Database Error'
,
(
except
:
raise
'Database Error'
,
(
'%s is not connected to a database'
%
self
.
id
)
'%s is not connected to a database'
%
self
.
id
)
...
@@ -265,7 +270,7 @@ class DA(
...
@@ -265,7 +270,7 @@ class DA(
argdata
=
self
.
_argdata
(
REQUEST
)
argdata
=
self
.
_argdata
(
REQUEST
)
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_quote'
]
=
DB__
.
sql_quote__
argdata
[
'sql_quote'
]
=
dbc
.
sql_quote__
query
=
apply
(
self
.
template
,
(
p
,),
argdata
)
query
=
apply
(
self
.
template
,
(
p
,),
argdata
)
if
src__
:
return
query
if
src__
:
return
query
...
@@ -283,7 +288,12 @@ class DA(
...
@@ -283,7 +288,12 @@ class DA(
def
query
(
self
,
REQUEST
,
RESPONSE
):
def
query
(
self
,
REQUEST
,
RESPONSE
):
' '
' '
try
:
DB__
=
getattr
(
self
,
self
.
connection_id
)()
try
:
dbc
=
getattr
(
self
,
self
.
connection_id
)
except
AttributeError
:
raise
AttributeError
,
(
"The database connection, <em>%s</em>, cannot be found."
)
try
:
DB__
=
dbc
()
except
:
raise
'Database Error'
,
(
except
:
raise
'Database Error'
,
(
'%s is not connected to a database'
%
self
.
id
)
'%s is not connected to a database'
%
self
.
id
)
...
@@ -301,7 +311,7 @@ class DA(
...
@@ -301,7 +311,7 @@ class DA(
else
:
p
=
None
else
:
p
=
None
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_delimiter'
]
=
'
\
0
'
argdata
[
'sql_quote'
]
=
DB__
.
sql_quote__
argdata
[
'sql_quote'
]
=
dbc
.
sql_quote__
query
=
apply
(
self
.
template
,(
p
,),
argdata
)
query
=
apply
(
self
.
template
,(
p
,),
argdata
)
if
self
.
cache_time_
:
if
self
.
cache_time_
:
...
@@ -428,6 +438,10 @@ def getBrain(self,
...
@@ -428,6 +438,10 @@ def getBrain(self,
##############################################################################
##############################################################################
#
#
# $Log: DA.py,v $
# $Log: DA.py,v $
# 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.
#
# Revision 1.42 1998/04/27 18:31:32 jim
# Revision 1.42 1998/04/27 18:31:32 jim
# Changed the way quoting was exported.
# Changed the way quoting was exported.
#
#
...
...
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