[Checkins] SVN: five.grok/trunk/ Fix the editform with grokcore.formlib 1.1, the apply action was gone.

Sylvain Viollon sylvain at infrae.com
Fri Jun 5 09:52:04 EDT 2009


Log message for revision 100648:
  Fix the editform with grokcore.formlib 1.1, the apply action was gone.
  
  

Changed:
  U   five.grok/trunk/docs/HISTORY.txt
  U   five.grok/trunk/src/five/grok/components.py
  U   five.grok/trunk/src/five/grok/ftests/form/form.py

-=-
Modified: five.grok/trunk/docs/HISTORY.txt
===================================================================
--- five.grok/trunk/docs/HISTORY.txt	2009-06-05 12:00:56 UTC (rev 100647)
+++ five.grok/trunk/docs/HISTORY.txt	2009-06-05 13:52:04 UTC (rev 100648)
@@ -4,6 +4,9 @@
 five.grok - 1.0b1 (unreleased)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Fix EditForm when used with grokcore.formlib 1.1. The Apply actions
+  was gone. [thefunny42]
+
 * Let static resource directories allow access to unprotected subattributes
   to avoid authorisation problems when accessing them from protected code.
   [optilude]

Modified: five.grok/trunk/src/five/grok/components.py
===================================================================
--- five.grok/trunk/src/five/grok/components.py	2009-06-05 12:00:56 UTC (rev 100647)
+++ five.grok/trunk/src/five/grok/components.py	2009-06-05 13:52:04 UTC (rev 100648)
@@ -202,7 +202,11 @@
     martian.baseclass()
     template = default_form_template
 
+    # grokcore.formlib defines empty actions since 1.1. Restore save
+    # option here.
+    actions = formbase.EditForm.actions
 
+
 class DisplayForm(GrokForm, formbase.DisplayForm, View):
 
     martian.baseclass()

Modified: five.grok/trunk/src/five/grok/ftests/form/form.py
===================================================================
--- five.grok/trunk/src/five/grok/ftests/form/form.py	2009-06-05 12:00:56 UTC (rev 100647)
+++ five.grok/trunk/src/five/grok/ftests/form/form.py	2009-06-05 13:52:04 UTC (rev 100648)
@@ -5,7 +5,7 @@
   >>> from Products.Five.testbrowser import Browser
   >>> browser = Browser()
   >>> browser.handleErrors = False
-  
+
   We can test the display form as default view:
 
   >>> browser.open("http://localhost/manfred")
@@ -16,7 +16,7 @@
   </html>
 
   But we have an edition form:
-  
+
   >>> browser.open("http://localhost/manfred/edit")
   >>> browser.getControl('Name').value = 'Arthur'
   >>> browser.getControl('Age').value = '325'
@@ -42,22 +42,25 @@
 from zope.schema.fieldproperty import FieldProperty
 
 class IMammoth(interface.Interface):
-    
+
     name = schema.TextLine(title=u"Name")
     age = schema.Int(title=u"Age")
 
+
 class Mammoth(grok.Model):
-    
+
     grok.implements(IMammoth)
 
     name = FieldProperty(IMammoth['name'])
     age = FieldProperty(IMammoth['age'])
 
+
 class Edit(grok.EditForm):
 
     grok.context(IMammoth)
 
+
 class Index(grok.DisplayForm):
-    
+
     grok.context(IMammoth)
 



More information about the Checkins mailing list