Tuesday, March 1, 2011

Re: How to reduce DB queries?

On 27 Lut, 16:26, galago <prog...@gmail.com> wrote:
> In template in main loop I want to display all technologies assigned to the
> each site. Technologies are assigned by m2m relation. So I run subloop as
> You can see in code above. I want to reduce the number of queries executed
> by those subqueries. I want to know, if there is a better way to do this.

Take a look at this add-on: https://github.com/lilspikey/django-batch-select
The example in Readme looks exactly like what you need.

--
Tomasz Zielinski
pyconsultant.eu

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment