Thanks!
On Jan 7, 2:19 am, Daniel Roseman wrote:
> On Jan 7, 5:07 am, apramanik wrote:
>
>
>
> > Oops not a join, but still a db hit :).
>
> > On Jan 6, 9:03 pm, apramanik wrote:
>
> > > Hey all, if I have a foreign key on a model (say Model B has a foreign
> > > key to Model A) and I do someth
On Jan 7, 5:07 am, apramanik wrote:
> Oops not a join, but still a db hit :).
>
> On Jan 6, 9:03 pm, apramanik wrote:
>
> > Hey all, if I have a foreign key on a model (say Model B has a foreign
> > key to Model A) and I do something like this:
>
> > a = A.objects.get( pk = 1 )
> > b = B.objects.
Oops not a join, but still a db hit :).
On Jan 6, 9:03 pm, apramanik wrote:
> Hey all, if I have a foreign key on a model (say Model B has a foreign
> key to Model A) and I do something like this:
>
> a = A.objects.get( pk = 1 )
> b = B.objects.get( pk = 1 )
>
> if b.a == a :
> # Do something
Hey all, if I have a foreign key on a model (say Model B has a foreign
key to Model A) and I do something like this:
a = A.objects.get( pk = 1 )
b = B.objects.get( pk = 1 )
if b.a == a :
# Do something
Is that inefficient, since its doing a join to pull b.a? Should I be
comparing their ids?
4 matches
Mail list logo