Re: Finding unique ForeignKey enties.

2009-09-23 Thread Brian McKeever
To only get one image, you use a limit. like movie.images_set.all()[:1] On Sep 22, 2:37 pm, Joshua Russo wrote: > On Tue, Sep 22, 2009 at 7:23 PM, MV wrote: > > > I have a Movie model > > and I have a Image model > > the Image model has a ForeignKey(Movie) > > > Each Movie has an arbitrary amo

Re: Finding unique ForeignKey enties.

2009-09-22 Thread Joshua Russo
On Tue, Sep 22, 2009 at 7:23 PM, MV wrote: > > I have a Movie model > and I have a Image model > the Image model has a ForeignKey(Movie) > > Each Movie has an arbitrary amount of Images. > > I have a view where I list all the Movies. > For each Movie entry, I want one Image. > > How do I do that?