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
Ludovic Kiefer
erp5
Commits
a25ab9cf
Commit
a25ab9cf
authored
Apr 01, 2014
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type.Core.Folder: Expose BTree-style iteritems.
parent
3021c83e
Changes
1
Hide 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 @
a25ab9cf
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
import
transaction
import
transaction
from
collections
import
deque
from
collections
import
deque
from
AccessControl
import
ClassSecurityInfo
,
getSecurityManager
from
AccessControl
import
ClassSecurityInfo
,
getSecurityManager
from
AccessControl.ZopeGuards
import
NullIter
from
Acquisition
import
aq_base
,
aq_parent
,
aq_inner
from
Acquisition
import
aq_base
,
aq_parent
,
aq_inner
from
OFS.ObjectManager
import
ObjectManager
from
OFS.ObjectManager
import
ObjectManager
from
OFS.History
import
Historical
from
OFS.History
import
Historical
...
@@ -452,12 +453,7 @@ class FolderMixIn(ExtensionClass.Base):
...
@@ -452,12 +453,7 @@ class FolderMixIn(ExtensionClass.Base):
next_id
=
deque
(
x
for
x
in
container
.
objectIds
()
if
x
>=
next_id
)
next_id
=
deque
(
x
for
x
in
container
.
objectIds
()
if
x
>=
next_id
)
recurse_stack
[
depth
]
=
next_id
recurse_stack
[
depth
]
=
next_id
else
:
else
:
if
folder_handler
==
HBTREE_HANDLER
:
for
id
,
ob
in
container
.
iteritems
(
next_id
):
iteritems
=
container
.
_htree_iteritems
else
:
iteritems
=
container
.
_tree
.
iteritems
for
id
,
ob
in
iteritems
(
next_id
):
ob
=
ob
.
__of__
(
container
)
if
not
restricted
or
validate
(
container
,
container
,
id
,
ob
):
if
not
restricted
or
validate
(
container
,
container
,
id
,
ob
):
recurse_stack
[
depth
]
=
id
recurse_stack
[
depth
]
=
id
recurse
(
ob
,
depth
+
1
)
recurse
(
ob
,
depth
+
1
)
...
@@ -1054,6 +1050,15 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
...
@@ -1054,6 +1050,15 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
return
[]
return
[]
return
CMFBTreeFolder
.
items
(
self
,
*
args
,
**
kw
)
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
):
def
hasObject
(
self
,
id
):
if
self
.
_folder_handler
==
HBTREE_HANDLER
:
if
self
.
_folder_handler
==
HBTREE_HANDLER
:
if
self
.
_htree
is
None
:
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