How to display serial number columns and variables in Bottle template
class Sample(object):
def __init__(self):
self.val_1 = 1
self.val_2 = 2
self.val_3 = 3
self.val_4 = 4
self.val_5 = 5
self.val_6 = 6
self.val_7 = 7
self.val_8 = 8
self.val_9 = 9
self.val_10 = 10
% for i in range(1, 11):
{{ sample.__dict__['val_' + str(i)] }}
% end
Recommended Posts