1.1 --- a/WebStack/Webware.py Sat Feb 28 16:30:00 2004 +0000
1.2 +++ b/WebStack/Webware.py Sat Feb 28 20:55:18 2004 +0000
1.3 @@ -143,25 +143,19 @@
1.4 A framework-specific method which extracts the form fields from the
1.5 message body in the transaction.
1.6
1.7 - The returned object should employ the cgi.FieldStorage interface.
1.8 -
1.9 - The result of this method is dependent on the WebUtils.FieldStorage
1.10 - module's FieldStorage class.
1.11 + Returns a dictionary mapping field names to lists of values (even if a
1.12 + single value is associated with any given field name).
1.13 """
1.14
1.15 - return self.trans.request().fields()
1.16 -
1.17 - def get_fields(self):
1.18 + # Fix the non-list results.
1.19
1.20 - """
1.21 - A framework-specific method which extracts the form fields from the
1.22 - transaction. Typically, the origin of the form fields will be affected
1.23 - by the method specified in the transaction.
1.24 -
1.25 - The returned object should employ the cgi.FieldStorage interface.
1.26 - """
1.27 -
1.28 - return self.trans.request().fields()
1.29 + fields = {}
1.30 + for field_name, field_value in self.trans.request().fields().items():
1.31 + if type(field_value) == type([]):
1.32 + fields[field_name] = field_value
1.33 + else:
1.34 + fields[field_name] = [field_value]
1.35 + return fields
1.36
1.37 def get_user(self):
1.38