Re: creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-10 Thread Mario Zorz
Okay I got it by using QuerySet's API extra() method http://docs.djangoproject.com/en/dev/ref/models/querysets/ All I wanted after all is to get some fields from one model, get some fields from some other model (which is related to the first model through a foreignkey), and show that through

Re: creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-09 Thread Mario Zorz
On Mon, 2009-03-09 at 10:31:16 PM, Malcolm Tredinnick wrote: >> Is it possible in a django view, to take objects from 2 different >> models, which are related one to the other through a ForeignKey >> (primary key of one model is foreign key in the other model), make >> something similar to an SQL

Re: creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 18:04 -0700, Mario Zorz wrote: > Hi all > > Thanks in advance to whomever reads this :) > > Is it possible in a django view, to take objects from 2 different > models, which are related one to the other through a ForeignKey > (primary key of one model is foreign key in the

creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-09 Thread Mario Zorz
Hi all Thanks in advance to whomever reads this :) Is it possible in a django view, to take objects from 2 different models, which are related one to the other through a ForeignKey (primary key of one model is foreign key in the other model), make something similar to an SQL JOIN and have the