Author: eallen
Date: 2010-08-25 13:34:41 -0400 (Wed, 25 Aug 2010)
New Revision: 4222
Modified:
mgmt/newdata/cumin/python/cumin/grid/job.py
mgmt/newdata/cumin/python/cumin/qmfadapter.py
Log:
Fix BZ 626972: Implement paging for qmf based tables.
Modified: mgmt/newdata/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.py 2010-08-24 20:26:12 UTC (rev 4221)
+++ mgmt/newdata/cumin/python/cumin/grid/job.py 2010-08-25 17:34:41 UTC (rev 4222)
@@ -102,10 +102,14 @@
class JobSummariesAdapter(ObjectQmfAdapter):
def get_data(self, values, options):
+ first_index = options.offset
+ last_index = options.offset + options.limit
+
submission = values["obj"]
results = self.app.model.get_submission_job_summaries(submission)
rows = self.process_results(results)
- return rows
+ page = rows[first_index:last_index]
+ return page
def process_record(self, key, record):
field_data = list()
Modified: mgmt/newdata/cumin/python/cumin/qmfadapter.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/qmfadapter.py 2010-08-24 20:26:12 UTC (rev 4221)
+++ mgmt/newdata/cumin/python/cumin/qmfadapter.py 2010-08-25 17:34:41 UTC (rev 4222)
@@ -32,7 +32,7 @@
results.data = self.default
rows = self.process_results(results)
- return rows
+ return rows[options.offset:options.offset + options.limit]
def process_results(self, results):
""" take the dict response from the qmf call and return a list of
lists """
Show replies by date