I'm glad that we might have found the problem and now we are trying to
resolve it.

The page is "edit"

The __unicode__ methode for TrProductsVersion is:

    def __unicode__(self):
            return u'%s (version: %s)' %(self.catalogueid,
self.prodversionid)

Where "catalogueid" (this object has one foreignkey, not in his unicode
methode) and "prodversionid"(this object has only one field) are foreign
keys and their __unicode__ methodes looks like this:

    def __unicode__(self):
            return u'%s' %self.productname

    AND

    def __unicode__(self):
            return u'%s' %self.version



The __unicode__ methode for TLocation (this object has no foreign key) is:

    def __unicode__(self):
            return u'%s' %self.address


Finally the __unicode__ methode for TrRelatedService looks like this:

    def __unicode__(self):

            if self.clientservicename:
                    return u'%s' %(self.servicename)
            else:
                    return u'%s (%s)' %(self.conid, self.solutionid)

This object has 5 foreign keys and 3 ManyToManyField relation.

When I look at the traceback from the django_debug_toolbar, there is 1852
queries in 20956ms, there is several repetition of the same calls. And
there is a lot of unnacessary calls. How can I optimise that? what can I do
about it? is there a way to overwrite the page for a given object. Because
I realise that my custom pages take less time to load.

Regards,
VB



2012/3/13 Javier Guerra Giraldez <jav...@guerrag.com>

> On Tue, Mar 13, 2012 at 9:55 AM, Phanounou <virginia.bel...@gmail.com>
> wrote:
> > I installed the django_debug_toolbar and I see that in the sql part I
> have
> > 1852 queries in 18228.00ms.
>
> great, so this is indeed the problem.
>
> which page is this?, the listing or the edit page?  check the SQL
> code, which tables is it accessing?
>
> if this happens on the edit page, it might be when constructing the
> select elements.  how does the __unicode__ of the related models look
> like?
>
> --
> Javier
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to