On Tue, Jan 11, 2011 at 2:30 PM, Matias Aguirre wrote:
> So, basically you want this:
>
> C.objects.filter(Bref__Dref__id=D_id).values_list('Aref')
>
Thanks! it was exactly what I needed
--
Gianluca Sforna
http://morefedora.blogspot.com
http://identi.ca/giallu -
So, basically you want this:
C.objects.filter(Bref__Dref__id=D_id).values_list('Aref')
MatÃas
Excerpts from gia...@gmail.com's message of Tue Jan 11 07:58:05 -0200 2011:
> Let's say I have a model like:
>
> class A:
>
> class B:
> Dref = ForeignKey('D')
>
> class C:
> Aref =
Let's say I have a model like:
class A:
class B:
Dref = ForeignKey('D')
class C:
Aref = ForeignKey('A')
Bref = ForeignKey('B')
class D:
I also have a view taking a D_id parameter and in this view I would
like to create and show the list of A objects that are related to D
through the B
3 matches
Mail list logo