add: CombinedResultSet
This commit is contained in:
parent
5fbb588743
commit
66087e14dc
2 changed files with 20 additions and 0 deletions
|
@ -46,6 +46,7 @@ class Field(Component):
|
||||||
operator = 'in'
|
operator = 'in'
|
||||||
showTitle = True
|
showTitle = True
|
||||||
colspan=1
|
colspan=1
|
||||||
|
colheaderspan=1
|
||||||
colwidth='auto'
|
colwidth='auto'
|
||||||
coltextalign='left'
|
coltextalign='left'
|
||||||
colbordertop='1px solid #000'
|
colbordertop='1px solid #000'
|
||||||
|
|
|
@ -106,3 +106,22 @@ class ResultSet(object):
|
||||||
def categoryColumns(self):
|
def categoryColumns(self):
|
||||||
return self.context.getCategoryFields()
|
return self.context.getCategoryFields()
|
||||||
|
|
||||||
|
|
||||||
|
class CombinedResultSet(ResultSet):
|
||||||
|
|
||||||
|
def __init__(self, context, categorySet, resultSet):
|
||||||
|
self.context = context
|
||||||
|
self.categorySet = categorySet
|
||||||
|
self.resultSet = resultSet
|
||||||
|
self.totals = BaseRow(None, self)
|
||||||
|
|
||||||
|
def getResult(self):
|
||||||
|
result = []
|
||||||
|
for row in self.categorySet:
|
||||||
|
result.append(row)
|
||||||
|
for res in self.resultSet:
|
||||||
|
for f in self.categoryColumns:
|
||||||
|
if res.getRawValue(f.__name__) == row.getRawValue(f.__name__):
|
||||||
|
result.append(res)
|
||||||
|
return result
|
||||||
|
|
Loading…
Add table
Reference in a new issue