Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
d555aa80
Commit
d555aa80
authored
Jun 29, 2017
by
Ayush Tiwari
Committed by
Vincent Pelletier
Jul 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZSQLCatalog: Simplify methods for SQLCatalog class
parent
24c0e7d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+13
-10
No files found.
product/ZSQLCatalog/SQLCatalog.py
View file @
d555aa80
...
@@ -1670,18 +1670,10 @@ class Catalog(Folder,
...
@@ -1670,18 +1670,10 @@ class Catalog(Folder,
continue
continue
#LOG('catalogObjectList', 0, 'method_name = %s' % (method_name,))
#LOG('catalogObjectList', 0, 'method_name = %s' % (method_name,))
method
=
getattr
(
self
,
method_name
)
method
=
self
.
_getCatalogMethod
(
method_name
)
if
method
.
meta_type
in
(
"Z SQL Method"
,
"LDIF Method"
):
# Build the dictionnary of values
arguments
=
method
.
arguments_src
.
split
()
elif
method
.
meta_type
==
"Script (Python)"
:
arguments
=
\
method
.
func_code
.
co_varnames
[:
method
.
func_code
.
co_argcount
]
else
:
arguments
=
[]
kw
=
{
x
:
LazyIndexationParameterList
(
catalogged_object_list
,
kw
=
{
x
:
LazyIndexationParameterList
(
catalogged_object_list
,
x
,
argument_cache
)
x
,
argument_cache
)
for
x
in
arguments
}
for
x
in
self
.
_getCatalogMethodArgumentList
(
method
)
}
# Alter/Create row
# Alter/Create row
try
:
try
:
...
@@ -1705,6 +1697,17 @@ class Catalog(Folder,
...
@@ -1705,6 +1697,17 @@ class Catalog(Folder,
if
psyco
is
not
None
:
if
psyco
is
not
None
:
psyco
.
bind
(
_catalogObjectList
)
psyco
.
bind
(
_catalogObjectList
)
def
_getCatalogMethodArgumentList
(
self
,
method
):
if
method
.
meta_type
in
(
"Z SQL Method"
,
"LDIF Method"
):
# Build the dictionnary of values
return
method
.
arguments_src
.
split
()
elif
method
.
meta_type
==
"Script (Python)"
:
return
method
.
func_code
.
co_varnames
[:
method
.
func_code
.
co_argcount
]
return
()
def
_getCatalogMethod
(
self
,
method_name
):
return
getattr
(
self
,
method_name
)
security
.
declarePrivate
(
'beforeUncatalogObject'
)
security
.
declarePrivate
(
'beforeUncatalogObject'
)
def
beforeUncatalogObject
(
self
,
path
=
None
,
uid
=
None
):
def
beforeUncatalogObject
(
self
,
path
=
None
,
uid
=
None
):
"""
"""
...
...
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