[Checkins] SVN: plone.z3cform/trunk/ remove the unwanted distinction between wrapped and unwrapped subforms

David Glick davidglick at onenw.org
Fri Feb 26 15:02:34 EST 2010


Log message for revision 109476:
  remove the unwanted distinction between wrapped and unwrapped subforms

Changed:
  U   plone.z3cform/trunk/docs/HISTORY.txt
  U   plone.z3cform/trunk/plone/z3cform/interfaces.py
  U   plone.z3cform/trunk/plone/z3cform/layout.py
  U   plone.z3cform/trunk/plone/z3cform/templates.py
  U   plone.z3cform/trunk/plone/z3cform/templates.zcml

-=-
Modified: plone.z3cform/trunk/docs/HISTORY.txt
===================================================================
--- plone.z3cform/trunk/docs/HISTORY.txt	2010-02-26 17:03:49 UTC (rev 109475)
+++ plone.z3cform/trunk/docs/HISTORY.txt	2010-02-26 20:02:33 UTC (rev 109476)
@@ -4,7 +4,13 @@
 0.5.11 - unreleased
 -------------------
 
+* Remove the distinction between wrapped and unwrapped subforms. A subform is
+  always wrapped by the form that contains it, and can use a Zope 3 page
+  template.
+  [davisagli]
+
 * Fixed tests in Plone 3.
+  [davisagli]
 
 * [placeholder for optilude's changelog]
 

Modified: plone.z3cform/trunk/plone/z3cform/interfaces.py
===================================================================
--- plone.z3cform/trunk/plone/z3cform/interfaces.py	2010-02-26 17:03:49 UTC (rev 109475)
+++ plone.z3cform/trunk/plone/z3cform/interfaces.py	2010-02-26 20:02:33 UTC (rev 109476)
@@ -47,9 +47,3 @@
     
     This allows different handling of templates, for example.
     """
-
-class IWrappedSubForm(IWrappedForm):
-    """Marker interface applied to wrapped sub-forms during rendering.
-    
-    This allows different handling of templates, for example.
-    """

Modified: plone.z3cform/trunk/plone/z3cform/layout.py
===================================================================
--- plone.z3cform/trunk/plone/z3cform/layout.py	2010-02-26 17:03:49 UTC (rev 109475)
+++ plone.z3cform/trunk/plone/z3cform/layout.py	2010-02-26 20:02:33 UTC (rev 109476)
@@ -47,9 +47,7 @@
         Override this method if you have more than one form.
         """
         
-        if z3c.form.interfaces.ISubForm.providedBy(self.form_instance):
-            zope.interface.alsoProvides(self.form_instance, interfaces.IWrappedSubForm)
-        else:
+        if not z3c.form.interfaces.ISubForm.providedBy(self.form_instance):
             zope.interface.alsoProvides(self.form_instance, interfaces.IWrappedForm)
         
         z2.switch_on(self, request_layer=self.request_layer)

Modified: plone.z3cform/trunk/plone/z3cform/templates.py
===================================================================
--- plone.z3cform/trunk/plone/z3cform/templates.py	2010-02-26 17:03:49 UTC (rev 109475)
+++ plone.z3cform/trunk/plone/z3cform/templates.py	2010-02-26 20:02:33 UTC (rev 109476)
@@ -105,9 +105,6 @@
 wrapped_form_factory = FormTemplateFactory(path('wrappedform.pt'),
         form=plone.z3cform.interfaces.IWrappedForm,
     )
-wrapped_subform_factory = FormTemplateFactory(path('wrappedsubform.pt'),
-        form=plone.z3cform.interfaces.IWrappedSubForm,
-    )
 
 # Default templates for the standalone form use case
 
@@ -115,6 +112,8 @@
         form=z3c.form.interfaces.IForm
     )
 
-standalone_subform_factory = ZopeTwoFormTemplateFactory(path('subform.pt'),
+# Default templates for subforms
+
+subform_factory = FormTemplateFactory(path('subform.pt'),
         form=z3c.form.interfaces.ISubForm
     )

Modified: plone.z3cform/trunk/plone/z3cform/templates.zcml
===================================================================
--- plone.z3cform/trunk/plone/z3cform/templates.zcml	2010-02-26 17:03:49 UTC (rev 109475)
+++ plone.z3cform/trunk/plone/z3cform/templates.zcml	2010-02-26 20:02:33 UTC (rev 109476)
@@ -21,10 +21,11 @@
   <!-- Form templates for wrapped layout use case -->
   <adapter factory=".templates.layout_factory" />
   <adapter factory=".templates.wrapped_form_factory" />
-  <adapter factory=".templates.wrapped_subform_factory" />
   
   <!-- Form templates for standalone form use case -->
   <adapter factory=".templates.standalone_form_factory" />
-  <adapter factory=".templates.standalone_subform_factory" />
   
+  <!-- Form templates for subform use case -->
+  <adapter factory=".templates.subform_factory" />
+  
 </configure>



More information about the checkins mailing list