add: multivalue field

This commit is contained in:
hplattner 2012-03-22 17:18:10 +01:00
parent ce5924333c
commit ec319c1782
2 changed files with 26 additions and 0 deletions

View file

@ -95,5 +95,18 @@
</tal:column> </tal:column>
</div> </div>
<div metal:define-macro="container">
<tal:column define="values python:col.getDisplayValues(row)">
<table class="multivalue">
<tr>
<tal:values repeat="value values">
<td style="border:none;"
tal:content="value"></td>
</tal:values>
</tr>
</table>
</tal:column>
</div>
</html> </html>

View file

@ -201,3 +201,16 @@ class SubReportField(Field):
def getValue(self, row): def getValue(self, row):
ri = self.getReportInstance(row) ri = self.getReportInstance(row)
return ri.getResults() return ri.getResults()
class MultiValueField(Field):
"""A Container for report fields to manage columns representing multiple fields
"""
renderer = 'container'
def getValue(self, row):
return self.getRawValue(row)
def getDisplayValues(self, row):
return self.getValue(row)