Mercurial > hg > ltpdarepo
changeset 243:826a29703975 stable
Remove unused code.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Fri, 16 Dec 2011 19:09:37 +0100 |
parents | d98319d533b2 |
children | e6ed4e03074f |
files | src/ltpdarepo/views/browse.py |
diffstat | 1 files changed, 0 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/views/browse.py Fri Dec 16 19:09:22 2011 +0100 +++ b/src/ltpdarepo/views/browse.py Fri Dec 16 19:09:37 2011 +0100 @@ -168,8 +168,6 @@ query += " AND tsdata.t0 + INTERVAL tsdata.nsecs SECOND >= '%s'" % self._start if self._where: query += " AND %s" % self._where - if self._limit: - query += " LIMIT %d,%d" % self._limit return query @@ -240,13 +238,6 @@ return self.strftime('%Y-%m-%d %H:%M:%S %Z') -class DateTimeJSONEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, datetime): - return obj.strftime('%Y-%m-%dT%H:%M:%S%Z') - return super(DateTimeJSONEncoder, self).default(obj) - - class Request(object): """Retrieves and validates query parameters from the request""" @@ -268,15 +259,6 @@ # process incoming data self.process(self.formdata) - @staticmethod - def fromqs(string, columns, indexes={}): - from urlparse import parse_qs - from werkzeug.datastructures import MultiDict - # parse query string - formdata = parse_qs(string, keep_blank_values=True, strict_parsing=True) - formdata = MultiDict(formdata) - return Request(formdata, columns, indexes) - def process(self, formdata): fields = formdata.getlist('field') ops = formdata.getlist('operator') @@ -334,11 +316,6 @@ def query(self): return self.where, self.vals - def tostring(self): - query = ["%s %s '%s'" % (field, op, value) for field, op, value, err in self.criteria if not err] - string = ' AND '.join(s.replace(' ', ' ') for s in query) - return Markup(string) - class DateTimeField(Field): """Text input and that uses `dateutil.parser.parse` to parse the