Daniel,

I am working my way through 
http://www.djangoproject.com/documentation/db-api/#related-objects
at the moment trying to get a better grasp on how django handles SQL
relationships.

The way I got the above code to work was (following your suggestion):

{% for task in object.task_set.all %}
                <tr>
                        <td><a href="/task/{{ task.slug }}/">{{ task.title 
}}</a></td>
                        <td>{{ task.creationDate }}</td>
                        <td>{{ task.estimatedCompletion }}</td>
                </tr>
{% endfor %}

Logically, having read the django docs, and your last post, I would
have expected to use this "for" line instead:

{% for task in project.task_set.all %}

But that doesn't work. I had to use "object". Is this normal ?

Additionally, I then went on to try using my new-found knowledge on
another template.

This template shows recent taskUpdates. The model task is related to
taskUpdates. So I tried this:

<ul>
{% for taskUpdate in object.taskUpdate_set.all %}
<li> {{ taskUpdate.comment }} </li>
{% endfor %}
</ul>

and it doesn't work. Neither does:

<ul>
{% for taskUpdate in task.taskUpdate_set.all %}
<li> {{ taskUpdate.comment }} </li>
{% endfor %}
</ul>
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to