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
b15a39ec
Commit
b15a39ec
authored
Mar 27, 2007
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Collector #2264: browser:view should set __name__
parent
d60ce904
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
lib/python/Products/Five/browser/metaconfigure.py
lib/python/Products/Five/browser/metaconfigure.py
+1
-0
lib/python/Products/Five/browser/tests/pages.txt
lib/python/Products/Five/browser/tests/pages.txt
+10
-0
lib/python/Products/Five/browser/tests/pages.zcml
lib/python/Products/Five/browser/tests/pages.zcml
+8
-0
No files found.
lib/python/Products/Five/browser/metaconfigure.py
View file @
b15a39ec
...
@@ -251,6 +251,7 @@ class view(zope_app_view):
...
@@ -251,6 +251,7 @@ class view(zope_app_view):
except
:
except
:
cname
=
"GeneratedClass"
cname
=
"GeneratedClass"
cdict
[
'__name__'
]
=
name
newclass
=
makeClass
(
cname
,
bases
,
cdict
)
newclass
=
makeClass
(
cname
,
bases
,
cdict
)
_handle_for
(
_context
,
for_
)
_handle_for
(
_context
,
for_
)
...
...
lib/python/Products/Five/browser/tests/pages.txt
View file @
b15a39ec
...
@@ -86,6 +86,16 @@ sure it is now:
...
@@ -86,6 +86,16 @@ sure it is now:
>>> self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
>>> self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
<Products.Five.metaclass.NewStyleClass ...>
<Products.Five.metaclass.NewStyleClass ...>
Both browser:view and browser:page are ILocation providers, so make sure they
have a __name__ attribute:
>>> page = self.folder.unrestrictedTraverse('testoid/eagle.txt')
>>> page.__name__
u'eagle.txt'
>>> view = self.folder.unrestrictedTraverse('testoid/named_view')
>>> view.__name__
u'named_view'
ZPT-based browser pages
ZPT-based browser pages
-----------------------
-----------------------
...
...
lib/python/Products/Five/browser/tests/pages.zcml
View file @
b15a39ec
...
@@ -218,6 +218,14 @@
...
@@ -218,6 +218,14 @@
permission="zope2.Public"
permission="zope2.Public"
/>
/>
<!-- A named view -->
<browser:view
name="named_view"
for="Products.Five.tests.testing.simplecontent.ISimpleContent"
class=".pages.SimpleView"
permission="zope2.Public"
/>
<!-- XXX this should really be in Five.form.tests -->
<!-- XXX this should really be in Five.form.tests -->
<!-- protected edit form for permission check -->
<!-- protected edit form for permission check -->
...
...
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