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
676715f2
Commit
676715f2
authored
Nov 12, 2006
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #2232: Can't call DTML templates from Page Templates
parent
073a3350
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+1
-1
lib/python/Products/PageTemplates/tests/testExpressions.py
lib/python/Products/PageTemplates/tests/testExpressions.py
+14
-2
No files found.
doc/CHANGES.txt
View file @
676715f2
...
...
@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
- Collector #2232: Can't call DTML templates from Page Templates
- Collector #2213: Can't edit "old" ZopePageTemplate instances.
- Collector #2208: rewriting/setting the 'charset' part of the
...
...
lib/python/Products/PageTemplates/Expressions.py
View file @
676715f2
...
...
@@ -89,7 +89,7 @@ def render(ob, ns):
if
callable
(
base
):
try
:
if
getattr
(
base
,
'isDocTemp'
,
0
):
ob
=
call_with_ns
(
ob
,
ns
,
2
)
ob
=
ZRPythonExpr
.
call_with_ns
(
ob
,
ns
,
2
)
else
:
ob
=
ob
()
except
AttributeError
,
n
:
...
...
lib/python/Products/PageTemplates/tests/testExpressions.py
View file @
676715f2
...
...
@@ -12,6 +12,12 @@ class Dummy:
def
__call__
(
self
):
return
'dummy'
class
DummyDocumentTemplate
:
__allow_access_to_unprotected_subobjects__
=
1
isDocTemp
=
True
def
__call__
(
self
,
client
=
None
,
REQUEST
=
{},
RESPONSE
=
None
,
**
kw
):
return
'dummy'
class
ExpressionTests
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -23,7 +29,8 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
one
=
1
,
d
=
{
'one'
:
1
,
'b'
:
'b'
,
''
:
'blank'
,
'_'
:
'under'
},
blank
=
''
,
dummy
=
Dummy
()
dummy
=
Dummy
(),
dummy2
=
DummyDocumentTemplate
()
)
def
testCompile
(
self
):
...
...
@@ -47,7 +54,12 @@ class ExpressionTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def
testRenderedEval
(
self
):
ec
=
self
.
ec
assert
ec
.
evaluate
(
'dummy'
)
==
'dummy'
self
.
assertEquals
(
ec
.
evaluate
(
'dummy'
),
'dummy'
)
# http://www.zope.org/Collectors/Zope/2232
# DTML templates could not be called from a Page Template
# due to an ImportError
self
.
assertEquals
(
ec
.
evaluate
(
'dummy2'
),
'dummy'
)
def
testEval1
(
self
):
'''Test advanced expression evaluation 1'''
...
...
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