##// END OF EJS Templates
data-grid-app: added universal function for extracting ordering....
marcink -
r2040:a04ecb8d default
parent child Browse files
Show More
@@ -20,6 +20,7 b''
20
20
21 import time
21 import time
22 import logging
22 import logging
23 import operator
23
24
24 from pyramid.httpexceptions import HTTPFound
25 from pyramid.httpexceptions import HTTPFound
25
26
@@ -283,6 +284,15 b' class DataGridAppView(object):'
283 draw = safe_int(request.GET.get('draw'))
284 draw = safe_int(request.GET.get('draw'))
284 return draw, start, length
285 return draw, start, length
285
286
287 def _get_order_col(self, order_by, model):
288 if isinstance(order_by, basestring):
289 try:
290 return operator.attrgetter(order_by)(model)
291 except AttributeError:
292 return None
293 else:
294 return order_by
295
286
296
287 class BaseReferencesView(RepoAppView):
297 class BaseReferencesView(RepoAppView):
288 """
298 """
General Comments 0
You need to be logged in to leave comments. Login now