Changeset 65226 in vbox for trunk/src/VBox/ValidationKit/testmanager/core/testbox.py
- Timestamp:
- Jan 10, 2017 3:36:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/testbox.py
r65094 r65226 671 671 """ 672 672 673 kiSortColumn_sName = 0; 674 kiSortColumn_sOs = 1; 675 kiSortColumn_sOsVersion = 2; 676 kiSortColumn_sCpuVendor = 3; 677 kiSortColumn_sCpuArch = 4; 678 kiSortColumn_lCpuRevision = 5; 679 kiSortColumn_cCpus = 6; 680 kiSortColumn_cMbMemory = 7; 681 kiSortColumn_cMbScratch = 8; 682 kiSortColumn_fNestedPaging = 9; 683 kiSortColumn_iTestBoxScriptRev = 10; 684 kiSortColumn_iPythonHexVersion = 11; 685 kcMaxSortColumns = 12; 686 kdSortColumnMap = { 687 kiSortColumn_sName: 'TestBoxesWithStrings.sName', 688 kiSortColumn_sOs: 'TestBoxesWithStrings.sOs', 689 kiSortColumn_sOsVersion: 'TestBoxesWithStrings.sOsVersion', 690 kiSortColumn_sCpuVendor: 'TestBoxesWithStrings.sCpuVendor', 691 kiSortColumn_sCpuArch: 'TestBoxesWithStrings.sCpuArch', 692 kiSortColumn_lCpuRevision: 'TestBoxesWithStrings.lCpuRevision', 693 kiSortColumn_cCpus: 'TestBoxesWithStrings.cCpus', 694 kiSortColumn_cMbMemory: 'TestBoxesWithStrings.cMbMemory', 695 kiSortColumn_cMbScratch: 'TestBoxesWithStrings.cMbScratch', 696 kiSortColumn_fNestedPaging: 'TestBoxesWithStrings.fNestedPaging', 697 kiSortColumn_iTestBoxScriptRev: 'TestBoxesWithStrings.iTestBoxScriptRev', 698 kiSortColumn_iPythonHexVersion: 'TestBoxesWithStrings.iPythonHexVersion', 699 }; 673 700 674 701 def __init__(self, oDb): … … 694 721 return oData; 695 722 696 def fetchForListing(self, iStart, cMaxRows, tsNow ):723 def fetchForListing(self, iStart, cMaxRows, tsNow, aiSortColumns = None): 697 724 """ 698 725 Fetches testboxes for listing. … … 713 740 714 741 from testmanager.core.testboxstatus import TestBoxStatusData; 742 743 if aiSortColumns is None or len(aiSortColumns) == 0: 744 aiSortColumns = [self.kiSortColumn_sName,]; 715 745 716 746 if tsNow is None: … … 721 751 ' ON TestBoxStatuses.idTestBox = TestBoxesWithStrings.idTestBox\n' 722 752 'WHERE TestBoxesWithStrings.tsExpire = \'infinity\'::TIMESTAMP\n' 723 'ORDER BY TestBoxesWithStrings.sName\n'753 'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n' 724 754 'LIMIT %s OFFSET %s\n' 725 755 , (cMaxRows, iStart,)); … … 732 762 'WHERE tsExpire > %s\n' 733 763 ' AND tsEffective <= %s\n' 734 'ORDER BY TestBoxesWithStrings.sName\n'764 'ORDER BY ' + (', '.join([self.kdSortColumnMap[i] for i in aiSortColumns])) + '\n' 735 765 'LIMIT %s OFFSET %s\n' 736 766 , ( tsNow, tsNow, cMaxRows, iStart,));
Note:
See TracChangeset
for help on using the changeset viewer.