Re: How to handle nested backward lookups in a template for a generic detail view?

2017-08-09 Thread Thomas Hughes
e.image.url`. However, you can move your image to ProjectDetail model > (add field `image = models.ImageField(...)`) and use it like so: > > {% for detail in project.projectdetail_set.all %} > > {% endfor %} > > On 9 Aug 2017, at 15:33, Thomas Hughes > wrote: > > Just FYI -

Re: How to handle nested backward lookups in a template for a generic detail view?

2017-08-09 Thread Thomas Hughes
Just FYI - the issue was with using 'image.url' rather than 'image.image.url' in code labeled with 'do something with image' in the HTML template above. On Monday, August 7, 2017 at 3:52:15 PM UTC-4, Thomas Hughes wrote: > > I have a generic detail view serv

How to handle nested backward lookups in a template for a generic detail view?

2017-08-07 Thread Thomas Hughes
I have a generic detail view serving content for 'project' to an HTML template with the following code: {% for detail in project.projectdetail_set.all %} {% for image in detail.projectdetailimage_set.all %} do something with image {% endfor %} {% endfor %} and my models look l