Hello,

Thanks for your answers which helped me a lot.

Finally my models.py looks like:

def appointments_all(request):
        user = request.user
        appointments =
AppointmentParticipant.objects.filter(participant_user__pk=u.id).select_related(depth=2)
        return render_to_response('appointments_all.html', {"user" :
user, "appointments": appointments}, context_instance =
RequestContext(request))


appointments_all generates a SQL statement with all the implicit joins
I need.

So my appointments_all.html is similar to:

...
<h1>Appointments for {{ user.user_name }}</h1>

<table id='UserAppointments'>

{% for appointment in appointments %}
<tr>
<td>{{ appointment.appointment.description }}</td>
<td>{{ appointment.appointment.start_timestamp }}</td>
<td>{{ appointment.appointment.end_timestamp }}</td>
<td>{{ appointment.participant_role.description }}</td>
</tr>
{% endfor %}

</table>
...


Yours,
Michael

--~--~---------~--~----~------------~-------~--~----~
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