def order_by request qs print request GET if order in request GET try

1
2
3
4
5
6
7
8
def order_by(request, qs):
print request.GET
if 'order' in request.GET:
try:
qs = qs.order_by(request.GET['order'])
except FieldError:
pass
return qs