added the new object creation to the view anoop
authornishanth
Sat, 17 Jul 2010 01:42:30 +0530
branchanoop
changeset 128 16b3557b4260
parent 127 464b9fad6cb8
child 129 b5dfde8e43a9
added the new object creation to the view
sdi/views.py
templates/cnf_sgd_ptc.html
--- a/sdi/views.py	Sat Jul 17 01:33:07 2010 +0530
+++ b/sdi/views.py	Sat Jul 17 01:42:30 2010 +0530
@@ -212,8 +212,14 @@
     participant_info = ParticipantInfo()
     participant_info.participant = user
 
-    if request.method == "POST":
-        pass
+    form = ParticipantInfoForm(request.POST)
+    if request.method == "POST" and form.is_valid():
+        data = form.cleaned_data
+        participant_info.has_laptop_for_sagedays = True if data['has_laptop'] == "Yes" else False
+        participant_info.sprinted_already = True if data['sprinted_already'] == "Yes" else False
+        participant_info.will_sprint = data['will_sprint']
+        user_info.status_of_attending_sagedays 
+        return render_to_response("attending_sgd.html")
     else:
         return render_to_response("cnf_sgd_ptc.html", {"user":user})
 
--- a/templates/cnf_sgd_ptc.html	Sat Jul 17 01:33:07 2010 +0530
+++ b/templates/cnf_sgd_ptc.html	Sat Jul 17 01:42:30 2010 +0530
@@ -8,7 +8,8 @@
 <br /> <br />
 There are just a few more details we would like to know.<br />
 <br />
-Please fill the following details and confirm your participation.<br />
+Please fill the following details and confirm your participation<br />
+<br />
 <form action="?email={{user.email}}" method=post>
 		Will you bring your own laptop for Sage Days 25:
 		<ul><li><input type="radio" name="has_laptop_for_sagedays" value="Yes" /> Yes </li>