Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
77def8a2
Commit
77def8a2
authored
Aug 31, 2012
by
Laurence Rowe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement getParentNode() in OFS.SimpleItem.Item as it is widely used.
parent
7a4c5942
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
doc/CHANGES.rst
doc/CHANGES.rst
+1
-1
src/OFS/SimpleItem.py
src/OFS/SimpleItem.py
+7
-0
No files found.
doc/CHANGES.rst
View file @
77def8a2
...
...
@@ -101,7 +101,7 @@ Restructuring
- Removed `mime-types` option from `zope.conf`. You can use the `add_files`
API from `zope.contenttype` instead.
- Removed `OFS.ZDOM`.
- Removed `OFS.ZDOM`.
`OFS.SimpleItem.Item` now implements `getParentNode()`.
- Removed the last remaining code to support `SOFTWARE_HOME` and `ZOPE_HOME`.
...
...
src/OFS/SimpleItem.py
View file @
77def8a2
...
...
@@ -26,6 +26,7 @@ import time
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.SecurityInfo
import
ClassSecurityInfo
from
AccessControl.SecurityManagement
import
getSecurityManager
from
AccessControl.Permissions
import
access_contents_information
from
AccessControl.Permissions
import
view
as
View
from
AccessControl.unauthorized
import
Unauthorized
from
AccessControl.ZopeSecurityPolicy
import
getRoles
...
...
@@ -369,6 +370,12 @@ class Item(Base,
res
+=
'>'
return
res
security
.
declareProtected
(
access_contents_information
,
'getParentNode'
)
def
getParentNode
(
self
):
"""The parent of this node. All nodes except Document
DocumentFragment and Attr may have a parent"""
return
getattr
(
self
,
'__parent__'
,
None
)
InitializeClass
(
Item
)
...
...
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