merged. anoop
authoranoop
Wed, 14 Jul 2010 21:04:59 +0530
branchanoop
changeset 92 9f305face605
parent 91 9fab907060a7 (current diff)
parent 90 1a6e1af98624 (diff)
child 93 505989755cd8
merged.
sdi/views.py
--- a/sdi/forms.py	Wed Jul 14 21:04:12 2010 +0530
+++ b/sdi/forms.py	Wed Jul 14 21:04:59 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()
--- a/sdi/site/urls.py	Wed Jul 14 21:04:12 2010 +0530
+++ b/sdi/site/urls.py	Wed Jul 14 21:04:59 2010 +0530
@@ -1,6 +1,7 @@
 from django.conf.urls.defaults import *
 
 from sage_days.sdi.views import register, reg_complete, list_stats, homepage, send_invi, admin_login, admin_logout
+from sage_days.sdi.views import send_workshop_confirm
 
 urlpatterns = patterns('',
 		       (r'^register/$', register),
@@ -9,5 +10,6 @@
                        (r'^send_invi/$', send_invi),
                        (r'^login/$', admin_login),
                        (r'^logout/$', admin_logout),
+                       (r'^send_wsp_cnf/$', send_workshop_confirm),
                       )
 
--- a/sdi/views.py	Wed Jul 14 21:04:12 2010 +0530
+++ b/sdi/views.py	Wed Jul 14 21:04:59 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
 
@@ -107,6 +107,19 @@
         form = EmailForm()
         return render_to_response("send_invi.html", {"form":form})
 
+@login_required
+def send_workshop_confirm(request):
+    """ Show a list of all the ppl who requested for a workshop and 
+    send a confirmation mail to them if not sent.
+    """
+
+    matches = Registrant.objects.filter(need_for_python_workshop=True, registrantinfo__status_of_attending_workshop="1")
+    if request.method == "POST":
+        pass
+    else:
+        form = UserSelectForm(matches)
+        return render_to_response("send_workshop_confirm.html", {"form":form}) 
+
 def admin_login(request):
     """ basic login.
     """
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/send_workshop_confirm.html	Wed Jul 14 21:04:59 2010 +0530
@@ -0,0 +1,10 @@
+{% extends 'base.html' %}
+{% block title %}
+Workshop Confirmaton Mail
+{% endblock %}
+{% block content %}
+<form action="" method=post>
+		{{ form.as_p }}
+		<input type=submit value=send />
+</form>
+{% endblock %}