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
c61dea47
Commit
c61dea47
authored
Jun 01, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow access to ZopeIterator/PathIterator API from restricted Python
(e.g. python expressions)
parent
e1178c5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+4
-0
lib/python/Products/PageTemplates/tests/testExpressions.py
lib/python/Products/PageTemplates/tests/testExpressions.py
+8
-0
No files found.
lib/python/Products/PageTemplates/Expressions.py
View file @
c61dea47
...
...
@@ -152,6 +152,10 @@ class ZopeEngine(zope.app.pagetemplate.engine.ZopeEngine):
class
ZopeIterator
(
Iterator
):
# allow iterator API to be accessed from (restricted) Python TALES
# expressions
__allow_access_to_unprotected_subobjects__
=
True
# The things below used to be attributes in
# ZTUtils.Iterator.Iterator, however in zope.tales.tales.Iterator
# they're methods. We need BBB on the Python level so we redefine
...
...
lib/python/Products/PageTemplates/tests/testExpressions.py
View file @
c61dea47
...
...
@@ -69,6 +69,14 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
assert
ec
.
evaluate
(
'x | string:$one'
)
==
'1'
assert
ec
.
evaluate
(
'x | not:exists:x'
)
def
testIteratorZRPythonExpr
(
self
):
'''Test access to iterator functions from Python expressions'''
ec
=
self
.
ec
ec
.
beginScope
()
ec
.
setRepeat
(
'loop'
,
"python:[1,2,3]"
)
assert
ec
.
evaluate
(
"python:repeat['loop'].even()"
)
ec
.
endScope
()
def
testWrappers
(
self
):
"""Test if defer and lazy are returning their wrappers
"""
...
...
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