author | nishanth |
Sat, 29 May 2010 18:41:04 +0530 | |
changeset 24 | f79be1dd4a22 |
parent 23 | 2aae8293f3a7 |
child 25 | 30baf3c635c5 |
permissions | -rw-r--r-- |
15 | 1 |
from django.shortcuts import render_to_response, redirect |
7 | 2 |
|
3 |
from sage_days.sdi.models import Registrant |
|
24
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
4 |
from sage_days.sdi.forms import RegisterForm, SearchForm |
7 | 5 |
|
6 |
def register(request): |
|
7 |
""" The user register page. |
|
8 |
""" |
|
9 |
||
9 | 10 |
if request.method == "POST": |
14 | 11 |
form = RegisterForm(request.POST) |
12 |
if form.is_valid(): |
|
15 | 13 |
form.save() |
14 |
return redirect("/registration/complete") |
|
14 | 15 |
else: |
16 |
return render_to_response("register.html", {"form":form}) |
|
9 | 17 |
else: |
18 |
form = RegisterForm() |
|
19 |
return render_to_response("register.html", {"form":form}) |
|
22 | 20 |
|
21 |
def reg_complete(request): |
|
22 |
""" Tell the registration is successful. |
|
23 |
""" |
|
24 |
||
25 |
return render_to_response("reg_complete.html") |
|
23 | 26 |
|
27 |
def list_stats(request): |
|
28 |
""" List the statiscs of registered participants. |
|
29 |
""" |
|
30 |
||
24
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
31 |
if request.method == "POST": |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
32 |
form = SearchForm(request.POST) |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
33 |
if form.is_valid(): |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
34 |
pass |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
35 |
else: |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
36 |
return render_to_response("list_stats.html", {"form":form}) |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
37 |
else: |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
38 |
form = SearchForm() |
f79be1dd4a22
added clean methods for each attribute in search form
nishanth
parents:
23
diff
changeset
|
39 |
return render_to_response("list_stats.html", {"form":form}) |