コード例 #1
0
ファイル: globals.py プロジェクト: austin-taylor/web2py
 def parse_get_vars(self):
     """Takes the QUERY_STRING and unpacks it to get_vars
     """
     query_string = self.env.get('query_string', '')
     dget = urlparse.parse_qs(query_string, keep_blank_values=1)  # Ref: https://docs.python.org/2/library/cgi.html#cgi.parse_qs
     get_vars = self._get_vars = Storage(dget)
     for (key, value) in iteritems(get_vars):
         if isinstance(value, list) and len(value) == 1:
             get_vars[key] = value[0]
コード例 #2
0
 def parse_get_vars(self):
     """Takes the QUERY_STRING and unpacks it to get_vars
     """
     query_string = self.env.get('query_string', '')
     dget = urlparse.parse_qs(query_string, keep_blank_values=1)
     # Ref: https://docs.python.org/2/library/cgi.html#cgi.parse_qs
     get_vars = self._get_vars = Storage(dget)
     for (key, value) in iteritems(get_vars):
         if isinstance(value, list) and len(value) == 1:
             get_vars[key] = value[0]