Skip to content

Components with tables seem to update strangely #691

Answered by cro
cro asked this question in Q&A
Discussion options

You must be logged in to vote

Followup here, I think the actual issue here was that my models were indeed pulling in a lot of fields, and all these fields needed to be serialized so they could be pushed to the page. I did two things to correct this--first I applied @adamghill 's suggesting to use select_related, second I made sure that my query was only getting the fields I actually needed to display.

So rather than just

mq = Mover.objects.all()

I used

        mq = Mover.objects.prefetch_related("person_id", "team_id",
                                            "sending_org_id",
                                            "bicep_rating",
                                            "available").values("id", "person_i…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

cro
Jun 21, 2024
Author Sponsor

You must be logged in to vote
1 reply
@adamghill
Comment options

Answer selected by cro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants