nopaque/web/app/jobs/tables.py

28 lines
900 B
Python
Raw Normal View History

2020-06-10 12:25:57 +00:00
from flask_table import Table, Col, LinkCol
class JobInputTable(Table):
"""
Declares the table describing colum by column.
"""
classes = ['highlight', 'responsive-table']
filename = Col('Filename', column_html_attrs={'class': 'filename'},
th_html_attrs={'class': 'sort',
'data-sort': 'filename'})
url = LinkCol('Download', 'jobs.download_job_input',
url_kwargs=dict(job_id='job.id',
job_input_id='input_id'),
anchor_attrs={'class': 'waves-effect waves-light btn-small',
'download': ''})
class JobInputItem(object):
"""
Describes one item like one row per table.
"""
def __init__(self, filename, job, input_id):
self.filename = filename
self.job = job
self.input_id = input_id