This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
Use some read only fields in the Django admin #527
Merged
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.
Overview
The Facility, FacilityListItem, and FacilityMatch admin were loading combo boxes with all possible related objects. With a database populated with 10s of thousands of records this would make admin page requests so slow that the ECS task would be terminated.
This commit fixes that by simply making the related fields read only. This works because we would not want to adjust these specific foreign key relationships anyway.
While making some fields read only we also took the opportunity to also make the JSON status fields read only and add a helper to render them in a more readable way.
Connects #526
Demo
Facility
FacilityListItem
FacilityMatch
Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions
This
test/
branch was tested on staging which has a stale copy of production data.Checklist
fixup!
commits have been squashed