sqlalchemy-datatables
sqlalchemy-datatables copied to clipboard
How to wary rendered column data according to condition?
I noticed that it is possible to do custom rendering for column with ColumnDT("<a href=''>" + User.id + "</a>")
. How can I differ how the data is rendered according to a conditional? I would like to do something like this:
ColumnDT(
if(User.id == 1):
"<a href=''>" + User.id + "</a>"
else:
User.id
)
Ok got it. Apparently you need to just do it with columnDefs