1.1 --- a/WebStack/ModPython.py Wed Feb 25 22:29:56 2004 +0000
1.2 +++ b/WebStack/ModPython.py Wed Feb 25 22:30:23 2004 +0000
1.3 @@ -102,13 +102,56 @@
1.4
1.5 return self.trans.path_info
1.6
1.7 + def get_query_string(self):
1.8 +
1.9 + """
1.10 + A framework-specific method which gets the query string from the path in
1.11 + the request.
1.12 + """
1.13 +
1.14 + return self.trans.args
1.15 +
1.16 # Higher level request-related methods.
1.17
1.18 + def get_fields_from_path(self):
1.19 +
1.20 + """
1.21 + A framework-specific method which extracts the form fields from the
1.22 + path specified in the transaction. The underlying framework may refuse
1.23 + to supply fields from the path if handling a POST transaction.
1.24 +
1.25 + The returned object should employ the cgi.FieldStorage interface.
1.26 +
1.27 + The mod_python.util.FieldStorage class should get fields from the path
1.28 + in all situations, although it may then redefine such fields if
1.29 + identically-named fields are then specified in the body of a POST
1.30 + transaction.
1.31 + """
1.32 +
1.33 + return self.get_fields()
1.34 +
1.35 + def get_fields_from_body(self):
1.36 +
1.37 + """
1.38 + A framework-specific method which extracts the form fields from the
1.39 + message body in the transaction.
1.40 +
1.41 + The returned object should employ the cgi.FieldStorage interface.
1.42 +
1.43 + The mod_python.util.FieldStorage class may augment the fields from the
1.44 + body with fields found in the path.
1.45 + """
1.46 +
1.47 + return self.get_fields()
1.48 +
1.49 def get_fields(self):
1.50
1.51 """
1.52 A framework-specific method which extracts the form fields from the
1.53 - transaction.
1.54 + transaction. Typically, the origin of the form fields will be affected
1.55 + by the method specified in the transaction.
1.56 +
1.57 + The returned object should employ the cgi.FieldStorage interface.
1.58 """
1.59
1.60 return FieldStorage(self.trans, keep_blank_values=1)