コード例 #1
0
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)
コード例 #2
0
 def get():
     return {'message': 'Success', 'data': Controller.get_channels()}, 200