# HG changeset patch
# User nishanth
# Date 1279120657 -19800
# Node ID 1a6e1af986248951e0a2a78902dece85321b44e0
# Parent b8fc66038d0d21c2610fdd00a51bffb3b4cf153d
now selecting users through forms. created a form for that
diff -r b8fc66038d0d -r 1a6e1af98624 sdi/forms.py
--- a/sdi/forms.py Wed Jul 14 20:20:33 2010 +0530
+++ b/sdi/forms.py Wed Jul 14 20:47:37 2010 +0530
@@ -168,3 +168,11 @@
return username
+def UserSelectForm(users):
+
+ choices = [ (_.id, _.first_name) for _ in users ]
+ class myF(forms.Form):
+
+ selected_users = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=choices, required=False)
+
+ return myF()
diff -r b8fc66038d0d -r 1a6e1af98624 sdi/views.py
--- a/sdi/views.py Wed Jul 14 20:20:33 2010 +0530
+++ b/sdi/views.py Wed Jul 14 20:47:37 2010 +0530
@@ -5,7 +5,7 @@
from django.contrib.auth import authenticate, login, logout
from sage_days.sdi.models import Registrant
-from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm
+from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm
from sage_days.sdi.events import send_reg_complete_mail, mail_invi
from sage_days.settings import APACHE_URL_PREFIX as aup
@@ -117,7 +117,8 @@
if request.method == "POST":
pass
else:
- return render_to_response("send_workshop_confirm.html", {"matches":matches})
+ form = UserSelectForm(matches)
+ return render_to_response("send_workshop_confirm.html", {"form":form})
def admin_login(request):
""" basic login.
diff -r b8fc66038d0d -r 1a6e1af98624 templates/send_workshop_confirm.html
--- a/templates/send_workshop_confirm.html Wed Jul 14 20:20:33 2010 +0530
+++ b/templates/send_workshop_confirm.html Wed Jul 14 20:47:37 2010 +0530
@@ -3,7 +3,8 @@
Workshop Confirmaton Mail
{% endblock %}
{% block content %}
-{% for user in matches %}
-{{user}}
-{% endfor %}
+