# HG changeset patch # User Daniele Nicolodi # Date 1324058977 -3600 # Node ID 826a29703975baba7a76881238b3e65d12727898 # Parent d98319d533b25d89c1ef4c15927b4306e9f88657 Remove unused code. diff -r d98319d533b2 -r 826a29703975 src/ltpdarepo/views/browse.py --- 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