First rename your "image_fk" field in Image to "news" - it's a
relation from an image to a news, not from an image to another image,
and the "_fk" prefix is irrelevant.

Then, from a News instance, you'll be ables to access the related
images using younews.image_set.all in the templates, ie:


{% for news in object_list %}
    # display the news stuff here
    {% for image in news.image_set.all %}
       # display the image here
    {% endfor %}
{% endfor %}

Just skip the outer loop for the "single" template.

FWIW, all this is documented, and IIRC there are examples in the
tutorial.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to