[KSS-checkins] r52437 - kukit/kss.demo/branch/kss-zope-transition/kss/demo

jvloothuis at codespeak.net jvloothuis at codespeak.net
Wed Mar 12 23:10:09 CET 2008


Author: jvloothuis
Date: Wed Mar 12 23:10:09 2008
New Revision: 52437

Modified:
   kukit/kss.demo/branch/kss-zope-transition/kss/demo/simplecontent.py
Log:

Added an error method to the simple content class so that it calls the
kss error view. We can use this in the tests to make sure the view is
properly used etc.


Modified: kukit/kss.demo/branch/kss-zope-transition/kss/demo/simplecontent.py
==============================================================================
--- kukit/kss.demo/branch/kss-zope-transition/kss/demo/simplecontent.py	(original)
+++ kukit/kss.demo/branch/kss-zope-transition/kss/demo/simplecontent.py	Wed Mar 12 23:10:09 2008
@@ -29,6 +29,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from zope.interface import implements
 from interfaces import ISimpleContent
+from zope import component
 
 class SimpleContent(SimpleItem):
     implements(ISimpleContent)
@@ -50,6 +51,14 @@
         """
         return "Direct traversal worked"
 
+    security.declarePublic('direct')
+    def standard_error_message(self, error_type=None, error_value=None, 
+                               **kwargs):
+        request = self.aq_acquire('REQUEST')
+        view = component.getMultiAdapter((self, request), name='kss_view')
+        view.attach_error(error_type, error_value)
+        return 'Error Type: %s\nError Value: %s' % (error_type, error_value)
+
 InitializeClass(SimpleContent)
 
 manage_addSimpleContentForm = PageTemplateFile(


More information about the Kukit-checkins mailing list