0

I have the following table set up using flask-table

class ScreeningTable(Table):
    timedate = DatetimeCol('Date & Time', datetime_format='YYYY-MM-d, HH:MM')
    tickets = Col('Tickets available')

I want to add a ButtonCol using a screeningID variable, where every button has the same text, but sends the user to a link based on the value of screeningID for each line of the table. How do I do that?

Tasos500
  • 107
  • 2
  • 11

1 Answers1

0

This is the line I came up with:

screeningID = ButtonCol("Buy Tickets", "purchase", url_kwargs=dict(id='screeningID'))

To clarify, the first variable is the title of the header, which will also be the text on the button. The second one is the endpoint, and the third is the keyword argument, what gets pass over as part of the URL.

The same rules apply with LinkCols, as they were written to work identically.

Tasos500
  • 107
  • 2
  • 11