completed the register view
authornishanth
Sat, 29 May 2010 10:32:09 +0530
changeset 15 1c2d2e702aee
parent 14 ee492a4b9ebd
child 16 91518c60131d
completed the register view
sdi/models.py
sdi/views.py
--- a/sdi/models.py	Sat May 29 10:24:18 2010 +0530
+++ b/sdi/models.py	Sat May 29 10:32:09 2010 +0530
@@ -45,8 +45,8 @@
     knowledge_of_sage = models.CharField(max_length=1, choices=SAGE_KNOWLEDGE_CHOICES)
     tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True)
 
-    address = models.TextField(help_text="To send DVD containing tutorials on Python if required.")
-    phone_num = models.CharField(max_length=15, verbose_name="Phone Number")
+    address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True)
+    phone_num = models.CharField(max_length=15, verbose_name="Phone Number", blank=True)
 
     likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES)
 
--- a/sdi/views.py	Sat May 29 10:24:18 2010 +0530
+++ b/sdi/views.py	Sat May 29 10:32:09 2010 +0530
@@ -1,4 +1,4 @@
-from django.shortcuts import render_to_response
+from django.shortcuts import render_to_response, redirect
 
 from sage_days.sdi.models import Registrant
 from sage_days.sdi.forms import RegisterForm
@@ -10,7 +10,8 @@
     if request.method == "POST":
         form = RegisterForm(request.POST)
         if form.is_valid():
-            pass
+            form.save()
+            return redirect("/registration/complete")
         else:
             return render_to_response("register.html", {"form":form})
     else: