I spent a little time getting links to work in Datasette. Initially I overthough the problem, imagining that I needed to actual construct the html <a> tag for a link to get it to work in the Datasette table interface. I used the tip on appending text to SQL query results at StackOverflow to create html hyplerlink tags. This decidedly did not work, not becaue the tip was bad, but because Datasette will automatically link a web address without the need for link tags. In the end, the more simple query:
select id, question, class, subelement, group_index, group_number, answer, answer_a, answer_b, answer_c, answer_d, "https://hamdaise.wl.r.appspot.com/" || help_link AS help_link from ham_qs where "subelement" = :p0 order by group_index limit 101
worked like a champ.
Want links to open in new tabs? There's a plugin for that.
Comments
Post a Comment
Please leave your comments on this topic: