Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:26 PM, Konstantin S wrote: > > > > On Mar 24, 11:13 pm, Alex Gaynor wrote: > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S > wrote: > > > > > Hello! > > > > > I have two unrelated models that have one common field. > > > > > class Media(models.Model): > > >title

Re: Join unrelated models

2009-03-24 Thread Konstantin S
On Mar 24, 11:13 pm, Alex Gaynor wrote: > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: > > > Hello! > > > I have two unrelated models that have one common field. > > > class Media(models.Model): > >    title = models.CharField(max_length=500) > >    ... > > > class Link(models.Model):

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:15 PM, Paulo Köch wrote: > > Does that generate a join or a not in? This is very relevant for > performance. > > Cheers, > Paulo Köch > > > > On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S > wrote: > >> > >>

Re: Join unrelated models

2009-03-24 Thread Paulo Köch
Does that generate a join or a not in? This is very relevant for performance. Cheers, Paulo Köch On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: >> >> Hello! >> >> I have two unrelated models that have one common field. >> >> class

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: > > Hello! > > I have two unrelated models that have one common field. > > class Media(models.Model): >title = models.CharField(max_length=500) >... > > class Link(models.Model): >title = models.CharField(max_length=500) >... >

Join unrelated models

2009-03-24 Thread Konstantin S
Hello! I have two unrelated models that have one common field. class Media(models.Model): title = models.CharField(max_length=500) ... class Link(models.Model): title = models.CharField(max_length=500) ... Now I want to select those objects from the Media model that do not exis