Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
162f20b0
Commit
162f20b0
authored
Jul 15, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Initialize ZSQLMethod class from SQLMethod __init__
parent
0e05c4e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
product/ERP5/Document/SQLMethod.py
product/ERP5/Document/SQLMethod.py
+25
-3
No files found.
product/ERP5/Document/SQLMethod.py
View file @
162f20b0
...
...
@@ -44,6 +44,9 @@ manage_addSQLMethodForm = DTMLFile('../dtml/addSQLMethod', globals())
# New ZSQLMethod addition function
def
manage_addSQLMethod
(
self
,
id
,
title
=
''
,
connection_id
=
''
,
arguments
=
''
,
template
=
''
,
REQUEST
=
None
,
*
args
,
**
kw
):
...
...
@@ -53,7 +56,9 @@ def manage_addSQLMethod(self, id, title='',
id
=
str
(
id
)
title
=
str
(
title
)
c
=
SQLMethod
(
id
,
self
)
# Create SQLMethod object container
c
=
SQLMethod
(
id
,
title
,
connection_id
,
arguments
,
template
,
self
)
self
.
_setObject
(
id
,
c
)
c
=
self
.
_getOb
(
id
)
if
REQUEST
is
not
None
:
...
...
@@ -75,6 +80,9 @@ class SQLMethod(XMLObject, ZSQL):
# Add constructor methods
constructors
=
(
manage_addSQLMethodForm
,
manage_addSQLMethod
)
# Override manage and manage_main with ZSQL manage and manage_main respectively
manage
=
manage_main
=
ZSQL
.
manage
# View content list, Force /view, Standart option in python scripts
manage_options
=
(
XMLObject
.
manage_options
[
0
],
{
'icon'
:
''
,
'label'
:
'View'
,
'action'
:
'view'
})
\
...
...
@@ -88,8 +96,22 @@ class SQLMethod(XMLObject, ZSQL):
,
PropertySheet
.
SQLMethod
)
def
__init__
(
self
,
id
,
*
args
,
**
kw
):
def
__init__
(
self
,
id
,
title
=
''
,
connection_id
=
''
,
arguments
=
''
,
template
=
''
,
*
args
,
**
kw
):
"""
Assign attributes to this class and override ZSQL init method to have
consistency with manage_edit(as ZSQL init also creates manage_edit)
"""
# Add the properties as the attributes for the SQL Method objects
# Useful while migrating data from ZSQLMethods to ERP5 SQLMethod objects
self
.
id
=
id
self
.
title
=
title
self
.
connection_id
=
connection_id
self
.
arguments
=
arguments
self
.
template
=
template
# Do we really need to initialize XMLObject class ?
#XMLObject.__init__(self, *args, **kw)
ZSQL
.
__init__
(
self
,
id
,
title
,
connection_id
,
arguments
,
template
)
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