def buildreport(self, category=None): items = Hardware.select (order_by=Hardware.c.description) items = [(x.field_name, x.description) for x in items] tform = TableForm ("Build a Hardware report", fields = [CheckBoxList("hardware", options=items, validator=Int())], action = '/showreport', submit_text = "Build report!") return dict(tform=tform)
def _get_hardware_items(self): items = Hardware.select(order_by=Hardware.c.description) return [(x.field_name, x.description) for x in items]