Closed cldellow closed 1 year ago
Hmm. I tried adding a new route at /db/table/-/dux-insert
. It seems kinda fiddly - if I want to re-use the row template, I need to make sure I have the right context object.
Then I'll still need to invoke the render_cell / edit_control hooks myself.
I think I might try this from a different, more disgusting angle: respond on /db/table/dux-insert
.
We'll monkey patch Datasette.resolve_row
to return a candidate row.
/db/table/-/dux-insert
~ Handle/db/table/dux-insert
speciallyinsert-row
template with an extra body class ofinsert-row
.insert-row
permission._dux_edit=1
should be assumed for the insert page, even if the table is not default-editableThe response from the insert endpoint looks like:
...so we'll have to know what the pkey columns are. Maybe we can dump those into a JS variable on the page.