[z3-checkins] r10830 - z3/Five/trunk

philikon at codespeak.net philikon at codespeak.net
Mon Apr 18 21:22:49 MEST 2005


Author: philikon
Date: Mon Apr 18 21:22:49 2005
New Revision: 10830

Modified:
   z3/Five/trunk/browser.zcml
   z3/Five/trunk/skin.py
Log:
Fix Lennart's failing test.

Lennart believed that he had to monkey patch Zope3's StandardMacros
because it was a new-style class and thus couldn't be registered as
a view from Five (which is quite right). This fact gave him problems
with forms, because certain widgets require the use of the @@form_macros
view, which is based on StandardMacros.

My reasoning, as I've stated many times (e.g. in
http://codespeak.net/pipermail/z3-checkins/2005q1/000677.html) was that
we simply have to provide our own non-new-style (IOW, ExtensionClass-based)
@@form_macros view.

This is what this patch does. Nothing more. The test passes
(Yes, Lennart, I'm having my parade. Please let me :))


Modified: z3/Five/trunk/browser.zcml
==============================================================================
--- z3/Five/trunk/browser.zcml	(original)
+++ z3/Five/trunk/browser.zcml	Mon Apr 18 21:22:49 2005
@@ -24,6 +24,14 @@
       allowed_interface="zope.interface.common.mapping.IItemMapping"
       />
 
+  <browser:page
+      for="*"
+      name="form_macros"
+      permission="zope2.View"
+      class=".skin.FormMacros"
+      allowed_interface="zope.interface.common.mapping.IItemMapping"
+      />
+
   <view
       for="*"
       factory=".browser.AbsoluteURL"

Modified: z3/Five/trunk/skin.py
==============================================================================
--- z3/Five/trunk/skin.py	(original)
+++ z3/Five/trunk/skin.py	Mon Apr 18 21:22:49 2005
@@ -46,3 +46,7 @@
     macro_pages = ('five_template',
                    'widget_macros',
                    'form_macros',) 
+
+# copy of zope.app.form.browser.macros.FormMacros
+class FormMacros(StandardMacros):    
+    macro_pages = ('widget_macros', 'addform_macros')


More information about the z3-checkins mailing list