- def __init__(self):\r
- self.request = None\r
-\r
- def set_sort_method(self, sort):\r
- self.request.session['questions_sort_method'] = sort\r
-\r
- def sort_method(self, default):\r
- sort = self.request.REQUEST.get('sort', None)\r
- if sort is None:\r
- return self.request.session.get('questions_sort_method', default)\r
- else:\r
- self.set_sort_method(sort)\r
- return sort\r
-\r
- def page_size(self, default):\r
- pagesize = self.request.REQUEST.get('pagesize', None)\r
- if pagesize is None:\r
- return int(self.request.session.get('questions_pagesize', default))\r
- else:\r
- self.request.session['questions_pagesize'] = pagesize\r
- return int(pagesize)\r
-\r