samedi 1 juillet 2023

Using flask_table to make a checkbox input column

The DonationTable class I am using to show data. In the derived DonationRegisterTable class I want to have a checkbox instead of a BoolCol so user can edit the table. Is there a way to have a checkbox as a column using flask_table?

from flask_table import Table, BoolCol, Col, ButtonCol


class DonationTable(Table):
    classes = ["table", "table-bordered"]

    id = Col("Id", show=False)
    account_id = Col("Account ID", show=False)
    month = Col("Month")
    year = Col("Year")
    paid = BoolCol("Paid")


class DonationRegisterTable(DonationTable):
    # I want this to be a checkbox
    paid = ButtonCol("Paid", "register_donation", url_kwargs=dict(account_id='account_id'))




Aucun commentaire:

Enregistrer un commentaire