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
d3458376
Commit
d3458376
authored
Nov 12, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set 'this' on templateDict when calling DTML
parent
59155ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
lib/python/Products/PageTemplates/ZPythonExpr.py
lib/python/Products/PageTemplates/ZPythonExpr.py
+3
-3
lib/python/Products/PageTemplates/ZRPythonExpr.py
lib/python/Products/PageTemplates/ZRPythonExpr.py
+3
-2
No files found.
lib/python/Products/PageTemplates/ZPythonExpr.py
View file @
d3458376
...
...
@@ -89,7 +89,7 @@ Handler for Python expressions, using the pre-Python 2.1 restriction
machinery from PythonScripts.
"""
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
from
AccessControl
import
getSecurityManager
from
Products.PythonScripts.Guarded
import
_marker
,
\
...
...
@@ -126,9 +126,9 @@ def validate(accessed, container, name, value, dummy):
def
call_with_ns
(
f
,
ns
,
arg
=
1
):
td
=
TemplateDict
()
td
.
validate
=
validate
td
.
this
=
None
td
.
this
=
ns
[
'here'
]
td
.
_push
(
ns
[
'request'
])
td
.
_push
(
InstanceDict
(
ns
[
'here'
]
,
td
))
td
.
_push
(
InstanceDict
(
td
.
this
,
td
))
td
.
_push
(
ns
)
try
:
if
arg
==
2
:
...
...
lib/python/Products/PageTemplates/ZRPythonExpr.py
View file @
d3458376
...
...
@@ -88,7 +88,7 @@
Handler for Python expressions that uses the RestrictedPython package.
"""
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
from
AccessControl
import
full_read_guard
,
full_write_guard
,
\
safe_builtins
,
getSecurityManager
...
...
@@ -136,8 +136,9 @@ class Rtd(RestrictedDTML, TemplateDict):
def
call_with_ns
(
f
,
ns
,
arg
=
1
):
td
=
Rtd
()
td
.
this
=
ns
[
'here'
]
td
.
_push
(
ns
[
'request'
])
td
.
_push
(
InstanceDict
(
ns
[
'here'
]
,
td
))
td
.
_push
(
InstanceDict
(
td
.
this
,
td
))
td
.
_push
(
ns
)
try
:
if
arg
==
2
:
...
...
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