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
120b0686
Commit
120b0686
authored
Jul 20, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Override _setArgument property setter and use it to update other attributes
parent
8c7160b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
product/ERP5/Document/SQLMethod.py
product/ERP5/Document/SQLMethod.py
+23
-9
No files found.
product/ERP5/Document/SQLMethod.py
View file @
120b0686
...
...
@@ -83,9 +83,8 @@ class SQLMethod(XMLObject, ZSQL):
# 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'
})
\
# View content list, Force /view, Standard option in SQLMethod
manage_options
=
({
'icon'
:
''
,
'label'
:
'View'
,
'action'
:
'view'
},)
\
+
ZSQL
.
manage_options
# Declarative properties
...
...
@@ -96,11 +95,19 @@ class SQLMethod(XMLObject, ZSQL):
,
PropertySheet
.
SQLMethod
)
# Inheritence conflicts solved
__call__
=
ZSQL
.
__call__
__getitem__
=
ZSQL
.
__getitem__
PUT
=
ZSQL
.
PUT
index_html
=
ZSQL
.
index_html
manage_FTPget
=
ZSQL
.
manage_FTPget
dav__init
=
ZSQL
.
dav__init
def
__init__
(
self
,
id
,
title
=
''
,
connection_id
=
''
,
arguments
=
''
,
template
=
''
,
*
args
,
**
kw
):
template
=
''
):
"""
Assign attributes to this class and override ZSQL init method to have
consistency with manage_edit(as ZSQL init also creates manage_edit)
...
...
@@ -108,10 +115,17 @@ class SQLMethod(XMLObject, ZSQL):
# 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)
# Initializing ZSQL class object is important as this will call manage_edit
# which will change database method properties
ZSQL
.
__init__
(
self
,
id
,
title
,
connection_id
,
arguments
,
template
)
def
_setArgument
(
self
,
value
):
"""
We need to override this so as to generate _arg attribute for SQL Method.
"""
self
.
_baseSetArgument
(
value
)
self
.
manage_edit
(
self
.
title
,
self
.
connection_id
,
self
.
arguments_src
,
self
.
src
)
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