Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > class Action(models.Model): > >name = models.CharField(maxlength=64, unique=True) > >photo = models.ForeignKey('Photo', null=True, blank=True) > > Set 'raw_id_admin=True' on the 'ph

Re: django admin - too many sql-queries

2007-02-18 Thread James Bennett
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > class Action(models.Model): >name = models.CharField(maxlength=64, unique=True) >photo = models.ForeignKey('Photo', null=True, blank=True) Set 'raw_id_admin=True' on the 'photo' field -- otherwise Django will query the full list of Photos

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, Gary Wilson <[EMAIL PROTECTED]> wrote: > > On Feb 18, 10:48 am, "Honza Kr�l" <[EMAIL PROTECTED]> wrote: > > On 2/18/07, Tom? Pokorn? <[EMAIL PROTECTED]> wrote: > > > > > models.py attached. > > > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr?l wrote: > > > > > > that's odd can you po

Re: django admin - too many sql-queries

2007-02-18 Thread Gary Wilson
On Feb 18, 10:48 am, "Honza Král" <[EMAIL PROTECTED]> wrote: > On 2/18/07, Tom? Pokorn? <[EMAIL PROTECTED]> wrote: > > > models.py attached. > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr?l wrote: > > > > that's odd can you post your Model definition? > > definitely odd, list_select_related ap

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, Tom� Pokorn� <[EMAIL PROTECTED]> wrote: > models.py attached. > > > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr�l wrote: > > > > > that's odd can you post your Model definition? definitely odd, list_select_related appears to have no effect on the sql queries. even if I add photo to li

Re: django admin - too many sql-queries

2007-02-18 Thread Tomáš Pokorný
models.py attached. On Sun, 2007-02-18 at 16:51 +0100, Honza Král wrote: > > that's odd can you post your Model definition? > > > > > > > > > > > -- TomᚠPokorný = email: [EMAIL PROTECTED] mobil: +420 776 379 631 icq# 22996508 == 1.Robotická s.r.o. h

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > > > > http://www.djangoproject.com/documentation/model_api/#list-select-related > > > > a try add > >class Admin: > list_select_related = True > > to all models, but it has no effect - "Edit Action" is still very > slow. > > with this o

Re: django admin - too many sql-queries

2007-02-18 Thread VIK_Tomas
> > http://www.djangoproject.com/documentation/model_api/#list-select-related > a try add class Admin: list_select_related = True to all models, but it has no effect - "Edit Action" is still very slow. with this option in all models: 3598 queries without this option: 3598 queries -

Re: django admin - too many sql-queries

2007-02-18 Thread Honza Král
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > > Hi, > > I have db-model like this: > > class Action(models.Model): >name = models.CharField(maxlength=64, unique=True) >photo = models.ForeignKey('Photo', null=True, blank=True) > > class Album(models.Model): >action = models.ForeignK

django admin - too many sql-queries

2007-02-18 Thread VIK_Tomas
Hi, I have db-model like this: class Action(models.Model): name = models.CharField(maxlength=64, unique=True) photo = models.ForeignKey('Photo', null=True, blank=True) class Album(models.Model): action = models.ForeignKey(Action, null=True, blank=True) name = models.CharField(maxle