Re: displaying fields from 2 related models

2009-10-13 Thread grimmus
It's so simple, thanks alot for the speedy replies ! On Oct 13, 4:31 pm, Héctor García wrote: > Once you have passed your links queryset to the template context, you > can just do: > > {% for saved_link in links %} >     {{ saved_link.link.title }} >     {{ saved_link.link.pub_date }} > {% endfo

Re: displaying fields from 2 related models

2009-10-13 Thread Tom Evans
On Tue, 2009-10-13 at 07:23 -0700, grimmus wrote: > Hi, > > I have a model called Link that allows the user to save a URL with a > title and description. The website i am making is full of Links users > have added (like a bookmarking service) > > class Link(models.Model): > user = models.For

Re: displaying fields from 2 related models

2009-10-13 Thread Héctor García
Once you have passed your links queryset to the template context, you can just do: {% for saved_link in links %} {{ saved_link.link.title }} {{ saved_link.link.pub_date }} {% endfor %} (embed your HTML dress and you're done) Cheers! Hector Garcia - Web developer, musician NomadBlue URI

displaying fields from 2 related models

2009-10-13 Thread grimmus
Hi, I have a model called Link that allows the user to save a URL with a title and description. The website i am making is full of Links users have added (like a bookmarking service) class Link(models.Model): user = models.ForeignKey(User) title = models.CharField(max_length=200) lin