Beispiel #1
0
    def QueryString(self, variable, caseInsensitive = False, raw = False, default = None):
        if caseInsensitive:
            variable = variable.lower()
            for k, v in self.query.iteritems():
                if k.lower() == variable:
                    if not raw:
                        return htmlwriter.Pythonize(v)
                    return v

        elif self.query.has_key(variable):
            v = self.query[variable]
            if not raw:
                return htmlwriter.Pythonize(v)
            return v
        return default
Beispiel #2
0
    def QueryStrings(self, raw = False):
        ret = {}
        for k, v in self.query.iteritems():
            if raw:
                ret[k] = v
            else:
                ret[k] = htmlwriter.Pythonize(v)

        return ret
Beispiel #3
0
    def QueryStrings(self, raw = False):
        """
            Returns a dict containing all the query string variables, in pythonesque
            form.
        """
        ret = {}
        for k, v in self.query.iteritems():
            if raw:
                ret[k] = v
            else:
                ret[k] = htmlwriter.Pythonize(v)

        return ret
Beispiel #4
0
 def FormItems(self):
     return dict(((k, htmlwriter.Pythonize(v)) for k, v in self.form.items()))
Beispiel #5
0
 def Form(self, element):
     if not self.form.has_key(element):
         return None
     return htmlwriter.Pythonize(self.form[element])