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
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?
2 matches
Mail list logo