1.1 --- a/WebStack/ModPython.py Sat Feb 28 16:30:00 2004 +0000
1.2 +++ b/WebStack/ModPython.py Sat Feb 28 20:55:18 2004 +0000
1.3 @@ -109,7 +109,7 @@
1.4 the request.
1.5 """
1.6
1.7 - return self.trans.args
1.8 + return self.trans.args or ""
1.9
1.10 # Higher level request-related methods.
1.11
1.12 @@ -132,25 +132,23 @@
1.13 A framework-specific method which extracts the form fields from the
1.14 message body in the transaction.
1.15
1.16 - The returned object should employ the cgi.FieldStorage interface.
1.17 + Returns a dictionary mapping field names to lists of values (even if a
1.18 + single value is associated with any given field name).
1.19
1.20 The mod_python.util.FieldStorage class may augment the fields from the
1.21 body with fields found in the path.
1.22 """
1.23
1.24 - return self.get_fields()
1.25 + storage = FieldStorage(self.trans, keep_blank_values=1)
1.26
1.27 - def get_fields(self):
1.28 + # Traverse the storage, finding each field value.
1.29
1.30 - """
1.31 - A framework-specific method which extracts the form fields from the
1.32 - transaction. Typically, the origin of the form fields will be affected
1.33 - by the method specified in the transaction.
1.34 -
1.35 - The returned object should employ the cgi.FieldStorage interface.
1.36 - """
1.37 -
1.38 - return FieldStorage(self.trans, keep_blank_values=1)
1.39 + fields = {}
1.40 + for field in storage.list:
1.41 + if not fields.has_key(field.name):
1.42 + fields[field.name] = []
1.43 + fields[field.name].append(field.value)
1.44 + return fields
1.45
1.46 def get_user(self):
1.47