# HG changeset patch # User anoop # Date 1279121699 -19800 # Node ID 9f305face605e9148d96a6133a0275a332df2977 # Parent 9fab907060a7dca9debe774a30e8a118cc150c22# Parent 1a6e1af986248951e0a2a78902dece85321b44e0 merged. diff -r 9fab907060a7 -r 9f305face605 sdi/forms.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() diff -r 9fab907060a7 -r 9f305face605 sdi/site/urls.py --- 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), ) diff -r 9fab907060a7 -r 9f305face605 sdi/views.py --- 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. """ diff -r 9fab907060a7 -r 9f305face605 templates/send_workshop_confirm.html --- /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 %} +
+{% endblock %}