[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL - AbsoluteURL.py:1.1.2.4.4.1
Jim Fulton
jim@zope.com
Wed, 29 May 2002 11:10:20 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/ZopePublication/AbsoluteURL
Modified Files:
Tag: Zope3InWonderland-branch
AbsoluteURL.py
Log Message:
- Added permission_id attribute to adapter and utility directives.
- Got rid of old getView, getResource, and getDefaultViewName.
Renamed getRequestView to getView (and so on).
Changed view interface to use context, rather than getContext.
Introduced notion of presentation types (e.g. IBrowserPresentation,
which is cleaner than IBrowserPublisher).
- Began converting to get/queryFoo, which is much nicer.
- Many formatting fixups.
=== Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/AbsoluteURL.py 1.1.2.4 => 1.1.2.4.4.1 ===
from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
from Zope.Proxy.ContextWrapper import getWrapperContainer, getWrapperData
-from Zope.ComponentArchitecture import getRequestView
+from Zope.ComponentArchitecture import getView
class AbsoluteURL:
__implements__ = IBrowserPublisher
- def __init__(self, context):
+ def __init__(self, context, request):
self.__context = context
-
- def setViewRequest(self, request):
self.__request = request
def __str__(self):
@@ -38,7 +36,7 @@
if name is None or container is None:
raise TypeError, 'Not enough context information to get a URL'
- return "%s/%s" % (getRequestView(container, 'absolute_url', self.__request),
+ return "%s/%s" % (getView(container, 'absolute_url', self.__request),
name)
__call__ = __str__
@@ -48,10 +46,8 @@
__implements__ = IBrowserPublisher
- def __init__(self, context):
+ def __init__(self, context, request):
self.__context = context
-
- def setViewRequest(self, request):
self.__request = request
def __str__(self):