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
47eff56d
Commit
47eff56d
authored
Jan 22, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in testing code and added output of SQL query.
parent
784d503c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+18
-8
No files found.
lib/python/Shared/DC/ZRDB/DA.py
View file @
47eff56d
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.2
5 1998/01/21 22:59:34
jim Exp $'''
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
$Id: DA.py,v 1.2
6 1998/01/22 20:32:50
jim Exp $'''
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
import
OFS.SimpleItem
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
DocumentTemplate
,
marshal
,
md5
,
base64
,
DateTime
,
Acquisition
,
os
...
...
@@ -120,18 +120,23 @@ class DA(
def
manage_test
(
self
,
REQUEST
):
'Perform an actual query'
src
=
"Could not render the query template!"
result
=
()
try
:
src
=
self
(
REQUEST
,
1
)
result
=
self
(
REQUEST
)
r
=
custom_default_report
(
self
.
id
,
result
)
except
:
r
=
(
'<
hr><
strong>Error, <em>%s</em>:</strong> %s'
'<strong>Error, <em>%s</em>:</strong> %s'
%
(
sys
.
exc_type
,
sys
.
exc_value
))
report
=
HTML
(
'<html><BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
\
n
'
'<!--#var manage_tabs-->
\
n
%s
\
n
</body></html>'
%
r
)
'<!--#var manage_tabs-->
\
n
<hr>
\
n
%s
\
n
\
n
'
'<hr><strong>SQL used:</strong><br>
\
n
<pre>
\
n
%s
\
n
</pre>/n<hr>
\
n
'
'</body></html>'
%
(
r
,
src
))
return
apply
(
report
,(
self
,
REQUEST
),{
self
.
id
:
result
})
...
...
@@ -175,7 +180,7 @@ class DA(
return
result
def
__call__
(
self
,
REQUEST
=
None
,
**
kw
):
def
__call__
(
self
,
REQUEST
=
None
,
src__
=
0
,
**
kw
):
if
REQUEST
is
None
:
if
kw
:
REQUEST
=
kw
...
...
@@ -192,6 +197,8 @@ class DA(
argdata
=
self
.
_argdata
(
REQUEST
)
query
=
apply
(
self
.
template
,
(
self
,),
argdata
)
if
src__
:
return
query
if
self
.
cache_time_
:
result
=
self
.
_cached_result
(
DB__
,
(
query
,
self
.
max_rows_
))
else
:
result
=
DB__
.
query
(
query
,
self
.
max_rows_
)
...
...
@@ -341,6 +348,9 @@ def getBrain(self,
##############################################################################
#
# $Log: DA.py,v $
# Revision 1.26 1998/01/22 20:32:50 jim
# Fixed bug in testing code and added output of SQL query.
#
# Revision 1.25 1998/01/21 22:59:34 jim
# Updated for latest security model.
#
...
...
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