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
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
Kasra Jamshidi
erp5
Commits
ca080e76
Commit
ca080e76
authored
Apr 01, 2014
by
Vincent Pelletier
Committed by
Tatuya Kamada
Jun 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type.Core.Folder: Expose BTree-style iteritems.
parent
9b498797
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
product/ERP5Type/Core/Folder.py
product/ERP5Type/Core/Folder.py
+11
-6
No files found.
product/ERP5Type/Core/Folder.py
View file @
ca080e76
...
...
@@ -30,6 +30,7 @@
import
transaction
from
collections
import
deque
from
AccessControl
import
ClassSecurityInfo
,
getSecurityManager
from
AccessControl.ZopeGuards
import
NullIter
from
Acquisition
import
aq_base
,
aq_parent
,
aq_inner
from
OFS.ObjectManager
import
ObjectManager
from
OFS.History
import
Historical
...
...
@@ -415,12 +416,7 @@ class FolderMixIn(ExtensionClass.Base):
next_id
=
deque
(
x
for
x
in
container
.
objectIds
()
if
x
>=
next_id
)
recurse_stack
[
depth
]
=
next_id
else
:
if
folder_handler
==
HBTREE_HANDLER
:
iteritems
=
container
.
_htree_iteritems
else
:
iteritems
=
container
.
_tree
.
iteritems
for
id
,
ob
in
iteritems
(
next_id
):
ob
=
ob
.
__of__
(
container
)
for
id
,
ob
in
container
.
iteritems
(
next_id
):
if
not
restricted
or
validate
(
container
,
container
,
id
,
ob
):
recurse_stack
[
depth
]
=
id
recurse
(
ob
,
depth
+
1
)
...
...
@@ -1039,6 +1035,15 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
return
[]
return
CMFBTreeFolder
.
items
(
self
,
*
args
,
**
kw
)
def
iteritems
(
self
,
*
args
,
**
kw
):
if
self
.
_folder_handler
==
HBTREE_HANDLER
:
result
=
CMFHBTreeFolder
.
_htree_iteritems
(
self
,
*
args
,
**
kw
)
else
:
if
self
.
_tree
is
None
:
return
()
result
=
self
.
_tree
.
iteritems
(
*
args
,
**
kw
)
return
NullIter
(((
x
,
y
.
__of__
(
self
))
for
x
,
y
in
result
))
def
hasObject
(
self
,
id
):
if
self
.
_folder_handler
==
HBTREE_HANDLER
:
if
self
.
_htree
is
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