Re: Potential bug in select_related() as of Beta

2010-02-22 Thread subs...@gmail.com
http://code.djangoproject.com/ticket/12937 Went ahead and filed it here. I set the milestone for 1.2, I'm hoping that triggers a review at some point. On Feb 21, 7:16 pm, Russell Keith-Magee wrote: > On Mon, Feb 22, 2010 at 7:45 AM, subs...@gmail.com wrote: > > Sorry to be pushy, but I would li

Re: Potential bug in select_related() as of Beta

2010-02-21 Thread Russell Keith-Magee
On Mon, Feb 22, 2010 at 7:45 AM, subs...@gmail.com wrote: > Sorry to be pushy, but I would like to bump this or find the next tree > to bark up. A bug report is the best way forward here. When you make your report, obviously include the models, ORM query and SQL fragment that is generated. It wo

Re: Potential bug in select_related() as of Beta

2010-02-21 Thread subs...@gmail.com
Sorry to be pushy, but I would like to bump this or find the next tree to bark up. -S On Feb 17, 9:42 pm, "subs...@gmail.com" wrote: > bmodels.Contact.objects.select_related('IR_contact','consumer_contact','pro­gram','consumer').filter(consumer__file=file).order_by('- > date') > > Yeah, I figure

Re: Potential bug in select_related() as of Beta

2010-02-17 Thread subs...@gmail.com
bmodels.Contact.objects.select_related('IR_contact','consumer_contact','program','consumer').filter(consumer__file=file).order_by('- date') Yeah, I figured as much. -S On Feb 17, 4:34 pm, Jeremy Dunck wrote: > Erm, and the queryset creation. > > Also, people are en route to PyCon, so responses

Re: Potential bug in select_related() as of Beta

2010-02-17 Thread Jeremy Dunck
Erm, and the queryset creation. Also, people are en route to PyCon, so responses may be a bit slow. On Wed, Feb 17, 2010 at 3:30 PM, subs...@gmail.com wrote: > http://dpaste.com/160722/ > > class Contact(models.Model): >    program = models.ForeignKey('agency.Program') >    consumer = > models.F

Re: Potential bug in select_related() as of Beta

2010-02-17 Thread subs...@gmail.com
http://dpaste.com/160722/ class Contact(models.Model): program = models.ForeignKey('agency.Program') consumer = models.ForeignKey('consumer.Consumer',null=True,blank=True) date = models.DateField('Contact Date') notes = models.TextField() date_added = models.DateTimeField(edita

Re: Potential bug in select_related() as of Beta

2010-02-17 Thread Jeremy Dunck
We'll need your model definitions in order to help much. On Wed, Feb 17, 2010 at 2:54 PM, Steve wrote: > Hello all, > > I believe select_related is creating some extraneous joins in situations > where one is joining child models from a base model (model inheritance). > > Take the following SQL ge

Potential bug in select_related() as of Beta

2010-02-17 Thread Steve
Hello all, I believe select_related is creating some extraneous joins in situations where one is joining child models from a base model (model inheritance). Take the following SQL generated (dpaste here, probably more readable http://dpaste.com/160677/) SELECT (fields) FROM `base_contact`