def initialize(self): """Initialize the view to handle the request.""" LaunchpadView.initialize(self) cache = IJSONRequestCache(self.request).objects self.extractBugSubscriptionDetails(self.user, self.context, cache) cache['bug_is_private'] = self.context.private if self.user: cache['notifications_text'] = self.notifications_text
def test_JsonModelNamespace_traverse_LPView(self): # Test traversal for JSON model namespace, # ++model++ for a non-LaunchpadView context. request = get_current_browser_request() context = object() view = LaunchpadView(context, request) namespace = JsonModelNamespaceView(view, request) result = namespace.traverse(view, None) self.assertEqual(result, namespace)
def render(self): if self.dupe_email: return LaunchpadView.render(self) else: return ''
def __init__(self, context, request): # We use the current bug task as the context in order to get the # menu and portlets working. bugtask = getUtility(ILaunchBag).bugtask LaunchpadView.__init__(self, bugtask, request) self.comment = context
def __init__(self, context, request, system_name): LaunchpadView.__init__(self, context, request) self.system_name = system_name
def render(self): self.request.response.setHeader('content-type', 'text/xml;charset=utf-8') body = LaunchpadView.render(self) return body.encode('utf-8')
def render(self): self.request.response.setHeader("content-type", "text/xml;charset=utf-8") body = LaunchpadView.render(self) return body.encode("utf-8")