You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Datasette implementation that shows excerpts from larger documents. I'd like to let users click a link to see the full document if they want to. The catch: I don't store the full document; getting it requires an API call, which yields a pretty substantial JSON object.
I can construct the link just fine with what I do have in the underlying database. But clicking on it would bring users to the raw JSON. I'd like the link to open a Datasette template, retrieve the JSON object from the API and display the right parts of it through the template.
Is there a way to do this just with Datasette (or plugins)? I could imagine a plug-in that retrieves the JSON and treats it more or was like a query result, which would do the trick. Maybe jq can do that?
Or do I need to also have a flask app running, just to handle this retrieving and displaying the full document?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a Datasette implementation that shows excerpts from larger documents. I'd like to let users click a link to see the full document if they want to. The catch: I don't store the full document; getting it requires an API call, which yields a pretty substantial JSON object.
I can construct the link just fine with what I do have in the underlying database. But clicking on it would bring users to the raw JSON. I'd like the link to open a Datasette template, retrieve the JSON object from the API and display the right parts of it through the template.
Is there a way to do this just with Datasette (or plugins)? I could imagine a plug-in that retrieves the JSON and treats it more or was like a query result, which would do the trick. Maybe jq can do that?
Or do I need to also have a flask app running, just to handle this retrieving and displaying the full document?
Other solutions welcome!
Beta Was this translation helpful? Give feedback.
All reactions