mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 18:34:18 +00:00
30 lines
717 B
Python
30 lines
717 B
Python
from flask_table import Table, Col
|
|
|
|
|
|
class AdminUserTable(Table):
|
|
"""
|
|
Declares the table describing colum by column.
|
|
"""
|
|
classes = ['highlight', 'responsive-table']
|
|
username = Col('Username')
|
|
email = Col('Email')
|
|
role_id = Col('Role')
|
|
confirmed = Col('Confrimed Status')
|
|
|
|
|
|
class AdminUserItem(object):
|
|
"""
|
|
Describes one item like one row per table.
|
|
"""
|
|
|
|
def __init__(self, username, email, role_id, confirmed):
|
|
self.username = username
|
|
self.email = email
|
|
self.role_id = role_id
|
|
self.confirmed = confirmed
|
|
|
|
if self.role_id == 1:
|
|
self.role_id = 'User'
|
|
elif self.role_id == 2:
|
|
self.role_id = 'Admin'
|