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
d7810b79
Commit
d7810b79
authored
Oct 29, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to inherit testing methods from Aqueduct.Aqueduct.Searchable.
Updated __call__ so queries can be used in documents.
parent
8fa1f5db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
27 deletions
+23
-27
lib/python/Shared/DC/ZRDB/DA.py
lib/python/Shared/DC/ZRDB/DA.py
+23
-27
No files found.
lib/python/Shared/DC/ZRDB/DA.py
View file @
d7810b79
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''Generic Database adapter
$Id: DA.py,v 1.1
2 1997/09/26 22:17:45
jim Exp $'''
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
$Id: DA.py,v 1.1
3 1997/10/29 14:49:29
jim Exp $'''
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
import
string
,
OFS
.
Folder
,
Aqueduct
.
Aqueduct
,
Aqueduct
.
RDB
import
DocumentTemplate
,
marshal
,
md5
,
zlib
,
base64
,
DateTime
,
Acquisition
...
...
@@ -101,21 +101,33 @@ class Folder(OFS.Folder.Folder):
'Method for testing server connection information'
return
'PING'
class
Query
(
Aqueduct
.
Aqueduct
.
BaseQuery
,
Persistent
,
Acquisition
.
Implicit
):
class
Query
(
Aqueduct
.
Aqueduct
.
Searchable
):
'Database query object'
icon
=
'AqueductDA/DBAdapter_icon.gif'
meta_type
=
'Aqueduct Database Adapter'
hasAqueductClientInterface
=
1
_col
=
None
manage
=
HTMLFile
(
'AqueductDA/edit'
)
def
quoted_src
(
self
):
return
quotedHTML
(
self
.
src
)
def
_convert
(
self
):
try
:
del
self
.
manage_testForm
del
self
.
arguments
del
self
.
result_names
del
self
.
report_src
except
:
pass
try
:
self
.
_arg
=
parse
(
self
.
arguments_src
)
except
:
pass
def
manage_edit
(
self
,
key
,
title
,
arguments
,
template
,
REQUEST
=
None
):
'change query properties'
if
self
.
__dict__
.
has_key
(
'manage_testForm'
):
self
.
_convert
self
.
title
=
title
self
.
key
=
key
self
.
rotor
=
Rotor
(
key
)
...
...
@@ -130,33 +142,13 @@ class Query(Aqueduct.Aqueduct.BaseQuery,Persistent,Acquisition.Implicit):
action
=
REQUEST
[
'URL2'
]
+
'/manage_main'
,
)
def
manage_testForm
(
self
,
REQUEST
):
"""Provide testing interface"""
input_src
=
default_input_form
(
self
.
title_or_id
(),
self
.
_arg
,
'manage_test'
)
return
HTML
(
input_src
)(
self
,
REQUEST
)
def
manage_test
(
self
,
REQUEST
):
'Perform an actual query'
result
=
self
(
REQUEST
)
report
=
HTML
(
custom_default_report
(
self
.
id
,
result
))
return
apply
(
report
,(
self
,
REQUEST
),{
self
.
id
:
result
})
def
index_html
(
self
,
PARENT_URL
):
" "
raise
'Redirect'
,
(
"%s/manage_testForm"
%
PARENT_URL
)
def
_searchable_arguments
(
self
):
return
self
.
_arg
def
_searchable_result_columns
(
self
):
return
self
.
_col
def
__call__
(
self
,
REQUEST
):
def
__call__
(
self
,
REQUEST
=
None
):
try
:
DB__
=
self
.
database_connection
()
except
:
raise
'Database Error'
,
(
'%s is not connected to a database'
%
self
.
id
)
if
REQUEST
is
None
:
REQUEST
=
self
.
REQUEST
argdata
=
self
.
_argdata
(
REQUEST
)
query
=
self
.
template
(
self
,
argdata
)
result
=
DB__
.
query
(
query
)
...
...
@@ -209,6 +201,10 @@ class Query(Aqueduct.Aqueduct.BaseQuery,Persistent,Acquisition.Implicit):
##############################################################################
#
# $Log: DA.py,v $
# Revision 1.13 1997/10/29 14:49:29 jim
# Updated to inherit testing methods from Aqueduct.Aqueduct.Searchable.
# Updated __call__ so queries can be used in documents.
#
# Revision 1.12 1997/09/26 22:17:45 jim
# more
#
...
...
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