Show More
@@ -20,6 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | import time |
|
22 | 22 | import logging |
|
23 | import operator | |
|
23 | 24 | |
|
24 | 25 | from pyramid.httpexceptions import HTTPFound |
|
25 | 26 | |
@@ -283,6 +284,15 b' class DataGridAppView(object):' | |||
|
283 | 284 | draw = safe_int(request.GET.get('draw')) |
|
284 | 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 | 297 | class BaseReferencesView(RepoAppView): |
|
288 | 298 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now