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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yoji Takeuchi
erp5
Commits
c1fbc83a
Commit
c1fbc83a
authored
Sep 06, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CatalogTool: Extend "parent" support in getCategoryValueDictParameterDict
parent
22e91eea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+28
-4
No files found.
product/ERP5Catalog/CatalogTool.py
View file @
c1fbc83a
...
@@ -1091,12 +1091,36 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -1091,12 +1091,36 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
)
)
query_list
.
append
(
category_query
)
query_list
.
append
(
category_query
)
if
parent_document_set
is
not
None
:
if
parent_document_set
is
not
None
:
if
forward
:
if
strict_membership
:
query_list
.
append
(
SimpleQuery
(
query_list
.
append
(
SimpleQuery
(
parent_uid
=
{
parent_uid
=
{
document
.
getUid
()
document
.
getUid
()
for
document
in
parent_document_set
for
document
in
parent_document_set
},
},
))
))
else
:
query_list
.
append
(
SimpleQuery
(
path
=
{
x
.
getPath
().
replace
(
'_'
,
r'\
_
').replace('
%
', r'
\
%
') + '
/%
'
for x in parent_document_set
},
comparison_operator='
like
',
))
else:
parent_uid_set = {
document.getUid()
for document in parent_document_set
}
if not strict_membership:
for document in parent_document_set:
while True:
document = document.getParentValue()
uid = getattr(document, '
getUid
', lambda: None)()
if uid is None:
break
parent_uid_set.add(uid)
query_list.append(SimpleQuery(uid=parent_uid_set))
return ComplexQuery(query_list)
return ComplexQuery(query_list)
security.declarePublic('
getCategoryParameterDict
')
security.declarePublic('
getCategoryParameterDict
')
...
...
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