select_related for fk and prefetch_related for m2m in django, you can chain them together
On Wed, May 27, 2020 at 4:51 PM Soumen Khatua <soumenkhatua258@gmail.com> wrote:
Hi Folks,--I have many to many relationships and Foreign Key in the table, I'm using select_realted(foreign key filed name) to optimize the query but I want to fetch many to many and foreign key at the same time , How I can do this in very optimized way?Thank YouRegards,Soumen
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPUw6Wb6f-BCwUZfvgzGtsrbV1seq1iGbXyuqoH%3DKxZrJ2EyLg%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMKMUju19j7apa1pXZQcZTY-6ThTJC%3DAL2eQhtO7DL2oTk6Oog%40mail.gmail.com.
No comments:
Post a Comment