File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11def get_field (self ):
22 try :
3- field = self .REQUEST ['sort' ]
3+ field = self .GET ['sort' ]
44 except (KeyError , ValueError , TypeError ):
55 field = ''
66 return (self .direction == 'desc' and '-' or '' ) + field
77
88def get_direction (self ):
99 try :
10- return self .REQUEST ['dir' ]
10+ return self .GET ['dir' ]
1111 except (KeyError , ValueError , TypeError ):
1212 return 'desc'
1313
1414
1515class SortingMiddleware (object ):
1616 """
17- Inserts a variable representing the field (with direction of sorting)
18- onto the request object if it exists in either **GET** or **POST**
19- portions of the request.
17+ Inserts a variable representing the field (with direction of sorting) onto
18+ the request object if it exists in **GET** portions of the request.
2019 """
2120 def process_request (self , request ):
2221 request .__class__ .field = property (get_field )
You can’t perform that action at this time.
0 commit comments