Are you sure it's the query that's slow and not the template rendering 
and/or JavaScript performance?

On Wednesday, May 13, 2015 at 12:32:50 PM UTC-4, Timothy W. Cook wrote:
>
> I have a model with 13 M2M relations and some of those have a few thousand 
> instances. 
> This renders rather slowly in the Admin.
>
> Thinking about improvements I wonder if it will help to setup 
> prefetch_related queries
>
> https://docs.djangoproject.com/en/1.8/ref/models/querysets/#prefetch-related
>
> inside a  formfield_for_manytomany method?
>
>
> https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_manytomany
>
> ​I haven't tried it yet and am not even sure how to go about it.  But if 
> experienced developers think it will work, I'll give it a shot.
>
> Thoughts? ​
>
>
> ============================================
> Timothy Cook
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
> MLHIM http://www.mlhim.org
>
> 

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/58f721ad-2ee4-4016-ac6f-b48661c4ce5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to