now registered workshops appear on home page .
--- a/reg/views.py Thu Apr 15 15:51:16 2010 +0530
+++ b/reg/views.py Thu Apr 15 16:01:03 2010 +0530
@@ -22,8 +22,12 @@
"""
user = request.user
+ if user.is_authenticated() and user.is_active:
+ registered_events = user.event_attendees.all()
+ else:
+ registered_events = None
- return render_to_response('index.html', {'user':user})
+ return render_to_response('index.html', {'user':user, 'registered_events':registered_events})
def user_login(request):
""" get the user object from e-mail and then check for password.
--- a/templates/index.html Thu Apr 15 15:51:16 2010 +0530
+++ b/templates/index.html Thu Apr 15 16:01:03 2010 +0530
@@ -7,6 +7,16 @@
{% else %}
Welcome {{user.get_full_name}}<br />
{% endif %}
+
+ {% if user.is_active and registered_events %}
+ Workshops you have registered for:
+ <ul>
+ {% for a_event in registered_events %}
+ <li><a href="/reg/event/view/{{a_event.key}}">{{a_event.title}}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
{% if user.is_staff %}
<a href="/reg/event/create">Create an event</a><br />
{% endif %}