зеркало из https://github.com/mozilla/treeherder.git
Merge pull request #119 from mozilla/fix-resultset-paging
modified result set paging to work off of a result set id offset
This commit is contained in:
Коммит
2a7ba208c2
|
@ -375,7 +375,8 @@ class JobsModel(TreeherderModelBase):
|
|||
|
||||
return result_set_id_lookup
|
||||
|
||||
def get_result_set_list(self, offset, limit, full=True, conditions=None):
|
||||
def get_result_set_list(
|
||||
self, offset_id, limit, full=True, conditions=None):
|
||||
"""
|
||||
Retrieve a list of ``result_sets`` (also known as ``pushes``)
|
||||
If ``full`` is set to ``True`` then return revisions, too.
|
||||
|
@ -383,7 +384,6 @@ class JobsModel(TreeherderModelBase):
|
|||
|
||||
Mainly used by the restful api to list the pushes in the UI
|
||||
"""
|
||||
|
||||
replace_str, placeholders = self._process_conditions(
|
||||
conditions, self.INDEXED_COLUMNS['result_set']
|
||||
)
|
||||
|
@ -398,7 +398,7 @@ class JobsModel(TreeherderModelBase):
|
|||
proc=proc,
|
||||
replace=[replace_str],
|
||||
placeholders=placeholders,
|
||||
limit="{0},{1}".format(offset, limit),
|
||||
limit=limit,
|
||||
debug_show=self.DEBUG,
|
||||
)
|
||||
|
||||
|
|
|
@ -409,12 +409,12 @@ class ResultSetViewSet(viewsets.ViewSet):
|
|||
|
||||
filter = UrlQueryFilter(request.QUERY_PARAMS)
|
||||
|
||||
offset = filter.pop("offset", 0)
|
||||
offset_id = filter.pop("id__lt", 0)
|
||||
count = filter.pop("count", 10)
|
||||
full = filter.pop('full', 'true').lower() == 'true'
|
||||
|
||||
objs = jm.get_result_set_list(
|
||||
offset,
|
||||
offset_id,
|
||||
count,
|
||||
full,
|
||||
filter.conditions
|
||||
|
|
Загрузка…
Ссылка в новой задаче