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
Leo Le Bouter
erp5
Commits
d74fcfcc
Commit
d74fcfcc
authored
Sep 06, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Micro-optimize Base.isAncestryIndexable
parent
0e3b9820
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+10
-9
No files found.
product/ERP5Type/Base.py
View file @
d74fcfcc
...
@@ -2844,15 +2844,16 @@ class Base( CopyContainer,
...
@@ -2844,15 +2844,16 @@ class Base( CopyContainer,
"""
"""
Tells whether this document is indexable, taking into account its entire
Tells whether this document is indexable, taking into account its entire
ancestry: a document may only be indexed if its parent is indexable, and
ancestry: a document may only be indexed if its parent is indexable, and
it's parent's parent, etc until ERP5Site object (inclusive).
its parent's parent, etc until ERP5Site object (inclusive).
"""
"""
node
=
self
.
aq_inner
if
self
.
isIndexable
:
portal
=
aq_base
(
self
.
getPortalObject
())
node
=
self
.
aq_inner
.
aq_parent
is_indexable
=
self
.
isIndexable
portal
=
aq_base
(
node
.
getPortalObject
())
while
is_indexable
and
aq_base
(
node
)
is
not
portal
:
while
node
.
isSubtreeIndexable
():
node
=
node
.
aq_parent
if
aq_base
(
node
)
is
portal
:
is_indexable
=
node
.
isSubtreeIndexable
()
return
True
return
is_indexable
node
=
node
.
aq_parent
return
False
security
.
declarePrivate
(
'immediateReindexObject'
)
security
.
declarePrivate
(
'immediateReindexObject'
)
def
immediateReindexObject
(
self
,
*
args
,
**
kw
):
def
immediateReindexObject
(
self
,
*
args
,
**
kw
):
...
...
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