changeset 4425:e78462e0c7f1

pre-1.9: request.form has qs args and post data, 1.9: .form only post data, .args only qs args, .values both
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 18 Nov 2008 19:08:14 +0100
parents 5ad5753ae311
children 06f33d1ce4cb
files MoinMoin/action/PackagePages.py MoinMoin/action/SyncPages.py MoinMoin/action/newpage.py
diffstat 3 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/PackagePages.py	Sun Nov 16 22:20:21 2008 +0100
+++ b/MoinMoin/action/PackagePages.py	Tue Nov 18 19:08:14 2008 +0100
@@ -44,9 +44,8 @@
         redirects to new page.
         """
         _ = self.request.getText
-        form = self.request.form
 
-        if 'cancel' in form:
+        if 'cancel' in self.request.values:
             # User canceled
             return self.page.send_page()
 
@@ -65,14 +64,13 @@
     def package(self):
         """ Calls collectpackage() with the arguments specified. """
         _ = self.request.getText
-        form = self.request.form
 
         # Get new name from form and normalize.
-        pagelist = form.get('pagelist', u'')
-        packagename = form.get('packagename', u'')
-        include_attachments = form.get('include_attachments', False)
+        pagelist = self.request.values.get('pagelist', u'')
+        packagename = self.request.values.get('packagename', u'')
+        include_attachments = self.request.values.get('include_attachments', False)
 
-        if not form.get('submit'):
+        if not self.request.values.get('submit'):
             self.request.theme.add_msg(self.makeform(), "dialog")
             raise ActionError
 
--- a/MoinMoin/action/SyncPages.py	Sun Nov 16 22:20:21 2008 +0100
+++ b/MoinMoin/action/SyncPages.py	Tue Nov 18 19:08:14 2008 +0100
@@ -122,8 +122,8 @@
     def fix_params(self, params):
         """ Does some fixup on the parameters. """
         # Load the password
-        if "password" in self.request.form:
-            params["password"] = self.request.form["password"]
+        if "password" in self.request.values:
+            params["password"] = self.request.values["password"]
 
         # merge the pageList case into the pageMatch case
         if params["pageList"] is not None:
@@ -178,7 +178,7 @@
         params = self.fix_params(self.parse_page())
 
         try:
-            if "cancel" in self.request.form:
+            if "cancel" in self.request.values:
                 raise ActionStatus(_("Operation was canceled."), "error")
 
             if params["direction"] == UP:
--- a/MoinMoin/action/newpage.py	Sun Nov 16 22:20:21 2008 +0100
+++ b/MoinMoin/action/newpage.py	Tue Nov 18 19:08:14 2008 +0100
@@ -19,8 +19,8 @@
     def __init__(self, request, referrer):
         self.request = request
         self.referrer = referrer # The page the user came from
-        self.pagename = self.request.form.get('pagename')
-        self.nametemplate = self.request.form.get('nametemplate', '%s')
+        self.pagename = self.request.values.get('pagename')
+        self.nametemplate = self.request.values.get('nametemplate', '%s')
         self.nametemplate = self.nametemplate.replace('\x00', '')
 
     def checkAndCombineArguments(self):
@@ -82,11 +82,11 @@
             pagename = self.pagename
             query = {'action': 'edit', 'backto': self.referrer}
 
-            template = self.request.form.get('template', '')
+            template = self.request.values.get('template', '')
             if template:
                 query['template'] = template
 
-            parent = self.request.form.get('parent', '')
+            parent = self.request.values.get('parent', '')
             if parent:
                 pagename = "%s/%s" % (parent, pagename)