def ui_channels(): # Declare the table class ItemTable(Table): channel = Col('channel') separator = Col('separator') artist_before_title = Col('artist_before_title') # Add edit button edit = LinkCol('Edit', 'ui_edit_channel', url_kwargs=dict(identifier='channel')) # Add delete button delete = LinkCol('Delete', 'ui_delete_channel', url_kwargs=dict(identifier='channel')) # Get some data data = Controller.get_channels() # Populate the table table = ItemTable(data) # Render html return render_template("channels/channels.html", table=table)
def get(): return {'message': 'Success', 'data': Controller.get_channels()}, 200