On Mon, May 5, 2008 at 7:50 AM, chiefmoamba <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I'm trying to get a for loop to display data by user. So for example I
> have the following that will display all 'courses' running in my
> project:
>
> {% if course %}
>    <p>There are Courses</p>
>    <p>The current courses we are running are: {{course|join:", "}}</
> p>
> {% else %}
>    <p>There are currently no courses running.</p>
> {% endif %}
>
> But what I'd ideally like if for the user who is logged in to see just
> the courses he/she is on.
>
> Can any of you suggest how I might do that?
>
> Thanks for your help - always much appreciated!
>

Put logic in your view function so that the course template variable
provided to the template is filtered to include only courses that
request.user is in.

Karen

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