[Checkins] SVN: grok/trunk/src/grok/ Rename apply_changes back to applyChanges to comply with Grok's (now documented)

Philipp von Weitershausen philikon at philikon.de
Fri Mar 16 14:37:24 EDT 2007


Log message for revision 73231:
  Rename apply_changes back to applyChanges to comply with Grok's (now documented)
  naming conventions: http://mail.zope.org/pipermail/grok-dev/2007-March/000362.html
  

Changed:
  U   grok/trunk/src/grok/components.py
  U   grok/trunk/src/grok/ftests/form/actions.py
  U   grok/trunk/src/grok/ftests/form/addform.py

-=-
Modified: grok/trunk/src/grok/components.py
===================================================================
--- grok/trunk/src/grok/components.py	2007-03-16 18:35:02 UTC (rev 73230)
+++ grok/trunk/src/grok/components.py	2007-03-16 18:37:24 UTC (rev 73231)
@@ -405,9 +405,9 @@
             return
 
         self.update_form()
-        return self.render() 
+        return self.render()
 
-    def apply_changes(self, obj, **data):
+    def applyChanges(self, obj, **data):
         if form.applyChanges(obj, self.form_fields, data, self.adapters):
             event.notify(ObjectModifiedEvent(obj))
             return True

Modified: grok/trunk/src/grok/ftests/form/actions.py
===================================================================
--- grok/trunk/src/grok/ftests/form/actions.py	2007-03-16 18:35:02 UTC (rev 73230)
+++ grok/trunk/src/grok/ftests/form/actions.py	2007-03-16 18:37:24 UTC (rev 73231)
@@ -2,7 +2,7 @@
 Using the @grok.action decorator, different actions can be defined on
 a grok.Form. When @grok.action is used, the default behaviour (the
 'Apply' action) is not available anymore, but it can triggered
-manually by calling self.apply_changes(object, data).
+manually by calling self.applyChanges(object, data).
 
   >>> import grok
   >>> from grok.ftests.form.actions import Mammoth
@@ -57,14 +57,14 @@
 class Edit(grok.EditForm):
     @grok.action("Apply")
     def handle_apply(self, **data):
-        if self.apply_changes(self.context, **data):
+        if self.applyChanges(self.context, **data):
             self.status = 'Modified!'
         else:
             self.status = 'No changes!'
 
     @grok.action("Hairy")
     def handle_hairy(self, **data):
-        self.apply_changes(self.context, **data)
+        self.applyChanges(self.context, **data)
         self.context.size += " and hairy"
 
 class Meet(grok.Form):

Modified: grok/trunk/src/grok/ftests/form/addform.py
===================================================================
--- grok/trunk/src/grok/ftests/form/addform.py	2007-03-16 18:35:02 UTC (rev 73230)
+++ grok/trunk/src/grok/ftests/form/addform.py	2007-03-16 18:37:24 UTC (rev 73231)
@@ -61,7 +61,7 @@
 
     @grok.action('Add entry')
     def add(self, **data):
-        # instantiate Mammoth and then use self.apply_changes()
+        # instantiate Mammoth and then use self.applyChanges()
         self.context['ellie'] = ellie = Mammoth()
-        self.apply_changes(ellie, **data)
+        self.applyChanges(ellie, **data)
         self.redirect(self.url(ellie))



More information about the Checkins mailing list