-
-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Expand foreign key references in row view as well #2031
base: main
Are you sure you want to change the base?
Conversation
This is a very neat fix, for something I've been wanting for a while. Add a unit test for the row HTML page - I suggest against this page: https://latest.datasette.io/fixtures/foreign_key_references/1 - and I'll land this PR. You can model it on this test here: datasette/tests/test_table_html.py Lines 609 to 632 in a53b893
I think adding it to Thanks! |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2031 +/- ##
==========================================
- Coverage 92.46% 92.11% -0.36%
==========================================
Files 38 38
Lines 5750 5556 -194
==========================================
- Hits 5317 5118 -199
- Misses 433 438 +5
... and 8 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
d39fa8b
to
98c7206
Compare
I've implemented the test (thanks for pointing me in the right direction!). At tmcl-it/datasette:0.64.1+row-view-expand-labels I also have a variant of this patch that applies to the 0.64.x branch. Please let me know if you'd be interested in merging that as well and I'll open another PR. |
Sure, let's merge that one too - it can go out in the next |
98c7206
to
ef25867
Compare
I've rebased my patch on the latest main. It should be ready to merge. |
ef25867
to
d903e48
Compare
Hi @simonw, I've again rebased my patch on the latest main. Could you merge it? |
Unlike the table view, the single row view does not resolve foreign key references into labels. This patch extracts the foreign key reference expansion code from TableView.data() into a standalone function that is then called by both TableView.data() and RowView.data().
📚 Documentation preview 📚: https://datasette--2031.org.readthedocs.build/en/2031/