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
24184a87
Commit
24184a87
authored
Sep 14, 2007
by
Christian Theune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated manual to reflect reality about Zope 2 security and views.
parent
6ecd6200
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
lib/python/Products/Five/doc/manual.txt
lib/python/Products/Five/doc/manual.txt
+2
-10
No files found.
lib/python/Products/Five/doc/manual.txt
View file @
24184a87
...
@@ -268,9 +268,6 @@ view class are:
...
@@ -268,9 +268,6 @@ view class are:
attribute. Typically this comes from a base class, such as
attribute. Typically this comes from a base class, such as
``BrowserView``.
``BrowserView``.
* They need to be initialized with the Zope 2 security system, as
otherwise you cannot use the view.
* This also means they need to be part of the Zope 2 acquisition
* This also means they need to be part of the Zope 2 acquisition
system, as this is a requirement for Zope 2 security to
system, as this is a requirement for Zope 2 security to
function. The ``BrowserView`` base class, available from
function. The ``BrowserView`` base class, available from
...
@@ -283,22 +280,17 @@ An example of a simple view::
...
@@ -283,22 +280,17 @@ An example of a simple view::
from Products.Five import BrowserView
from Products.Five import BrowserView
class SimpleFolderView(BrowserView):
class SimpleFolderView(BrowserView):
security = ClassSecurityInfo()
security.declarePublic('eagle')
def eagle(self):
def eagle(self):
"""Test
"""Test
"""
"""
return "The eagle has landed: %s" % self.context.objectIds()
return "The eagle has landed: %s" % self.context.objectIds()
InitializeClass(SimpleFolderView)
Note that it is not a good idea to give a view class its own
Note that it is not a good idea to give a view class its own
``index_html``, as this confuses Five's view lookup machinery.
``index_html``, as this confuses Five's view lookup machinery.
As you can see, the class is initialized with the Zope 2 security
This view uses methods in Python, but you can also use other Zope 2 mechanisms
system. This view uses methods in Python, but you can also use other
such as ``PageTemplateFile``.
Zope 2 mechanisms such as ``PageTemplateFile``.
Finally, we need to hook up the pages through ZCML::
Finally, we need to hook up the pages through ZCML::
...
...
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