Repository navigation
Fix the box page N+1 queries; type-to-filter for the box assign list and the storage and consumables forms - #215
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #207
Closes #209
#207: N+1 queries on the box page (Sentry PYTHON-DJANGO-37 and -38)
The box detail page (
/storage/detail/box/<id>/) built its slot grid with onelocations.get(row=..., column=...)per slot (about 100 queries for a 10 x 10 box), and the template then looked up each occupied slot's aliquot type and disposition separately.(row, column), with the sample, type and disposition loaded together. The list of positions is also sorted by row and column; before, its order was undefined.#209: type-to-filter for the rest of the forms
Continues #212, which did the aliquot and sample forms.
/samples/aliquot-options/) and starts empty each time the modal opens.form-control).Freezer A › Shelf 1,Freezer A › Shelf 1 › Rack 1), since names repeat across devices and typing to find one would be ambiguous."Create New Boxe"
Reported while testing: the list pages formed the singular by chopping the last letter (
model_name|slice:\":-1\"), which gives "Boxe" and "Shelve". A newsingulartemplate filter (insample_tags) replaces it in all ten places across the sample, storage and consumables lists: Boxes becomes Box, Shelves becomes Shelf, Categories becomes Category, Aliquot Types becomes Aliquot Type, and case is kept. The storage and consumables lists also said "1 boxes found"; they now say "1 box found".Not changed
No migrations or model changes. The assign view itself is unchanged: it still takes
aliquot_id, and the picker offers any non-deleted aliquot, as the old dropdown did.Verification
storage/tests/test_box_page.py(28 tests): the query counts above, the grid and counts, the picker markup and reset, the modal theme and no-scroll rules, assigning, the storage and consumables form labels and marks, and the singular filter and its pages. Full suite on the merged branch: 855 tests, OK.makemigrations --checkis clean.Please check
🤖 Generated with Claude Code