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
8d0a884e
Commit
8d0a884e
authored
Aug 28, 2007
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit first version of AQBBB
parent
7289f70e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
+28
-24
lib/python/Products/Five/bbb.py
lib/python/Products/Five/bbb.py
+25
-3
lib/python/Products/Five/browser/__init__.py
lib/python/Products/Five/browser/__init__.py
+3
-21
No files found.
lib/python/Products/Five/bbb.py
View file @
8d0a884e
...
...
@@ -19,9 +19,31 @@ from zope.interface import Interface, implements
from
zope.component.interfaces
import
ComponentLookupError
from
zope.app.publisher.browser
import
getDefaultViewName
import
zExceptions
import
Products.Five.security
from
Products.Five
import
fivemethod
import
Acquisition
class
AquisitionBBB
(
object
):
"""Emulate a class implementing Acquisition.interfaces.IAcquirer and
IAcquisitionWrapper.
"""
def
__of__
(
self
,
context
):
# Technically this isn't in line with the way Acquisition's
# __of__ works. With Acquisition, you get a wrapper around
# the original object and only that wrapper's parent is the
# new context.
return
self
aq_self
=
aq_inner
=
aq_base
=
property
(
lambda
self
:
self
)
aq_chain
=
property
(
Acquisition
.
aq_chain
)
aq_parent
=
property
(
Acquisition
.
aq_parent
)
def
aq_acquire
(
self
,
*
args
,
**
kw
):
return
Acquisition
.
aq_acquire
(
self
,
*
args
,
**
kw
)
def
aq_inContextOf
(
self
,
*
args
,
**
kw
):
return
Acquisition
.
aq_inContextOf
(
self
,
*
args
,
**
kw
)
class
IBrowserDefault
(
Interface
):
"""Provide a hook for deciding about the default view for an object"""
...
...
lib/python/Products/Five/browser/__init__.py
View file @
8d0a884e
...
...
@@ -18,23 +18,16 @@ $Id$
import
Acquisition
import
zope.publisher.browser
class
BrowserView
(
zope
.
publisher
.
browser
.
BrowserView
):
from
Products.Five.bbb
import
AquisitionBBB
# BBB for code that expects BrowserView to still inherit from
# Acquisition.Explicit.
class
BrowserView
(
zope
.
publisher
.
browser
.
BrowserView
,
AquisitionBBB
):
# Use an explicit __init__ to work around problems with magically inserted
# super classes when using BrowserView as a base for viewlets.
def
__init__
(
self
,
context
,
request
):
zope
.
publisher
.
browser
.
BrowserView
.
__init__
(
self
,
context
,
request
)
def
__of__
(
self
,
context
):
# Technically this isn't in line with the way Acquisition's
# __of__ works. With Acquisition, you get a wrapper around
# the original object and only that wrapper's parent is the
# new context.
return
self
# Classes which are still based on Acquisition and access
# self.context in a method need to call aq_inner on it, or get a
# funky aq_chain. We do this here for BBB friendly purposes.
...
...
@@ -46,14 +39,3 @@ class BrowserView(zope.publisher.browser.BrowserView):
self
.
_parent
=
parent
aq_parent
=
__parent__
=
property
(
__getParent
,
__setParent
)
# We provide the aq_* properties here for BBB
aq_self
=
aq_inner
=
aq_base
=
property
(
lambda
self
:
self
)
aq_chain
=
property
(
Acquisition
.
aq_chain
)
def
aq_acquire
(
self
,
*
args
,
**
kw
):
return
Acquisition
.
aq_acquire
(
self
,
*
args
,
**
kw
)
def
aq_inContextOf
(
self
,
*
args
,
**
kw
):
return
Acquisition
.
aq_inContextOf
(
self
,
*
args
,
**
kw
)
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