Don't do it in the template layer! Why not get the list of events in
the view layer, do the iterate there and mark which ones the current
user is attending. Then you have the logic in python and he template
layer is kept simple.



On Nov 7, 2:34 am, Patrick Deuley <[email protected]> wrote:
> I've got a list of events, each event has a list of people attending
> through a m2m relationship.
>
> I want to display a list of events, and display an "RSVP for this
> event" link on each event, based on wether or not the request.user is
> already attending.
>
> How can I determine if the request.user is in the attending list as i
> iterate through the events? Since the templating system doesn't
> support complex logic, I'm not sure how I would do this.
>
> - Patrick D

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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