equal
deleted
inserted
replaced
86 limit = min(MAX_PAGINATION, limit) |
86 limit = min(MAX_PAGINATION, limit) |
87 |
87 |
88 return limit, offset |
88 return limit, offset |
89 |
89 |
90 |
90 |
91 def getListContent(request, params, logic, filter=None, idx=0): |
91 def getListContent(request, params, filter=None, idx=0): |
92 """Returns a dict with fields used for rendering lists. |
92 """Returns a dict with fields used for rendering lists. |
93 |
93 |
94 Args: |
94 Args: |
95 request: the Django HTTP request object |
95 request: the Django HTTP request object |
96 params: a dict with params for the View this list belongs to |
96 params: a dict with params for the View this list belongs to |
97 logic: the logic object for the View this list belongs to |
|
98 filter: a filter for this list |
97 filter: a filter for this list |
99 idx: the index of this list |
98 idx: the index of this list |
100 |
99 |
101 Returns: |
100 Returns: |
102 A a dictionary with the following values set: |
101 A a dictionary with the following values set: |
114 'first': offset of the first item in the list |
113 'first': offset of the first item in the list |
115 'last': offest of the lst item in the list |
114 'last': offest of the lst item in the list |
116 } |
115 } |
117 """ |
116 """ |
118 |
117 |
|
118 logic = params['logic'] |
|
119 |
119 limit, offset = getLimitAndOffset(request, idx) |
120 limit, offset = getLimitAndOffset(request, idx) |
120 arg_name = 'limit_%d' % idx |
121 arg_name = 'limit_%d' % idx |
121 pagination_form = makePaginationForm(request, limit, arg_name) |
122 pagination_form = makePaginationForm(request, limit, arg_name) |
122 |
123 |
123 # Fetch one more to see if there should be a 'next' link |
124 # Fetch one more to see if there should be a 'next' link |