sdi/views.py
author Anoop Jacob Thomas<anoop@fossee.in>
Tue, 09 Nov 2010 12:02:42 +0530
branchanoop
changeset 246 3a32df4b3171
parent 242 6826f27064c9
permissions -rw-r--r--
added custom invitation mail page.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
1c2d2e702aee completed the register view
nishanth
parents: 14
diff changeset
     1
from django.shortcuts import render_to_response, redirect
98
e6140a4cac5d forgot to import http404 .. fixed it
nishanth
parents: 97
diff changeset
     2
from django.http import HttpResponse, Http404
65
0ca63c964237 now login is required for accessing stats and send_invi pages
nishanth
parents: 57
diff changeset
     3
from django.contrib.auth.decorators import login_required
97
bf16c82df506 forgot an import .. fixed it
nishanth
parents: 95
diff changeset
     4
from django.utils.datastructures import MultiValueDictKeyError
7
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
     5
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
     6
from django.contrib.auth import authenticate, login, logout
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
     7
120
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
     8
from sage_days.sdi.models import Registrant, RegistrantInfo, ParticipantInfo
236
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
     9
from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm, ParticipantInfoForm, SendAccoForm, EditAddressForm
246
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
    10
from sage_days.sdi.events import send_reg_complete_mail, mail_invi, mail_cust_invi, send_sgd_ptc_confirm, send_cnf_email, send_wsp_ptc_confirm, send_acco_confirm_mail
72
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
    11
from sage_days.settings import APACHE_URL_PREFIX as aup
7
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
    12
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
    13
def register(request):
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
    14
    """ The user register page.
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
    15
    """
98f2b5c2abc9 added basic register view in views.py
nishanth
parents: 4
diff changeset
    16
9
47f72774489e added the return statement for register view
nishanth
parents: 7
diff changeset
    17
    if request.method == "POST":
14
ee492a4b9ebd updated register view
nishanth
parents: 9
diff changeset
    18
        form = RegisterForm(request.POST)
ee492a4b9ebd updated register view
nishanth
parents: 9
diff changeset
    19
        if form.is_valid():
136
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    20
            user = form.save()
53
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    21
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    22
            data = form.cleaned_data
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    23
            first_name = data['first_name']
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    24
            last_name = data['last_name']
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    25
            email = data['email']
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    26
            send_reg_complete_mail(email, first_name, last_name)
b226923fbf64 added send_mail after registration
nishanth
parents: 48
diff changeset
    27
136
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    28
            user_info = RegistrantInfo()
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    29
            user_info.registrant = user
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    30
            user_info.status_of_attending_sagedays = "1"
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    31
            user_info.status_of_attending_workshop = True if user.need_for_python_workshop else False
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    32
            user_info.status_of_accomodation = "1" if user.acco_required else "0"
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    33
            user_info.save()
b68ff7095ca5 added the registrantinfo creation part in register view
nishanth
parents: 130
diff changeset
    34
26
212fcba4459e changed the app to work with apache + added base.html, and did needed changes.
anoop
parents: 25
diff changeset
    35
            return redirect("/sage_days/registration/complete")
14
ee492a4b9ebd updated register view
nishanth
parents: 9
diff changeset
    36
        else:
ee492a4b9ebd updated register view
nishanth
parents: 9
diff changeset
    37
            return render_to_response("register.html", {"form":form})
9
47f72774489e added the return statement for register view
nishanth
parents: 7
diff changeset
    38
    else:
47f72774489e added the return statement for register view
nishanth
parents: 7
diff changeset
    39
        form = RegisterForm()
47f72774489e added the return statement for register view
nishanth
parents: 7
diff changeset
    40
        return render_to_response("register.html", {"form":form})
22
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    41
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    42
def reg_complete(request):
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    43
    """ Tell the registration is successful.
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    44
    """
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    45
1df4b0e0d45c added the registration complete page
nishanth
parents: 15
diff changeset
    46
    return render_to_response("reg_complete.html")
23
2aae8293f3a7 added list statiscs page
nishanth
parents: 22
diff changeset
    47
65
0ca63c964237 now login is required for accessing stats and send_invi pages
nishanth
parents: 57
diff changeset
    48
@login_required
23
2aae8293f3a7 added list statiscs page
nishanth
parents: 22
diff changeset
    49
def list_stats(request):
2aae8293f3a7 added list statiscs page
nishanth
parents: 22
diff changeset
    50
    """ List the statiscs of registered participants.
2aae8293f3a7 added list statiscs page
nishanth
parents: 22
diff changeset
    51
    """
2aae8293f3a7 added list statiscs page
nishanth
parents: 22
diff changeset
    52
24
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    53
    if request.method == "POST":
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    54
        form = SearchForm(request.POST)
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    55
        if form.is_valid():
25
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    56
            data = form.cleaned_data
79
064ff60025d9 removed the need_python_workshop and need_acco fields since they are very confusing
nishanth
parents: 77
diff changeset
    57
064ff60025d9 removed the need_python_workshop and need_acco fields since they are very confusing
nishanth
parents: 77
diff changeset
    58
            #need_workshop = data['need_for_python_workshop']
064ff60025d9 removed the need_python_workshop and need_acco fields since they are very confusing
nishanth
parents: 77
diff changeset
    59
            #acco_required = data['need_accomodation']
064ff60025d9 removed the need_python_workshop and need_acco fields since they are very confusing
nishanth
parents: 77
diff changeset
    60
            #db_query = "Registrant.objects.filter(need_for_python_workshop=%s, acco_required=%s)"%(need_workshop, acco_required)
064ff60025d9 removed the need_python_workshop and need_acco fields since they are very confusing
nishanth
parents: 77
diff changeset
    61
            db_query = "Registrant.objects"
25
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    62
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    63
            topics_include, topics_exclude = data['topics_interested']
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    64
            for number in topics_include:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    65
                db_query += '.filter(topics_interested__contains="%s")'%number
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    66
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    67
            for number in topics_exclude:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    68
                db_query += '.exclude(topics_interested__contains="%s")'%number
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    69
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    70
            start_python, stop_python = data['knowledge_of_python']
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    71
            if start_python and stop_python:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    72
                db_query += '.filter(knowledge_of_python__gte="%s")'%start_python
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    73
                db_query += '.filter(knowledge_of_python__lte="%s")'%stop_python
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    74
            elif start_python:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    75
                db_query += '.filter(knowledge_of_python__exact="%s")'%start_python
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    76
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    77
            start_sage, stop_sage = data['knowledge_of_sage']
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    78
            if start_sage and stop_sage:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    79
                db_query += '.filter(knowledge_of_sage__gte="%s")'%start_sage
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    80
                db_query += '.filter(knowledge_of_sage__lte="%s")'%stop_sage
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    81
            elif start_sage:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    82
                db_query += '.filter(knowledge_of_sage__exact="%s")'%start_sage
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    83
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    84
            start_likeliness, stop_likeliness = data['likeliness_of_attending']
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    85
            if start_likeliness and stop_likeliness:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    86
                db_query += '.filter(likeliness_of_attending__gte="%s")'%start_likeliness
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    87
                db_query += '.filter(likeliness_of_attending__lte="%s")'%stop_likeliness
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    88
            elif start_likeliness:
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    89
                db_query += '.filter(likeliness_of_attending__exact="%s")'%start_likeliness
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    90
80
c200156c80a9 fixed a bug that arises when a query does not have any parameters to filter
nishanth
parents: 79
diff changeset
    91
            db_query += ".all()"
c200156c80a9 fixed a bug that arises when a query does not have any parameters to filter
nishanth
parents: 79
diff changeset
    92
25
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    93
            matches = eval(db_query)
30baf3c635c5 added list statiscs page
nishanth
parents: 24
diff changeset
    94
            return render_to_response("list_stats.html", {"form":form, 'matches':matches})
24
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    95
        else:
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    96
            return render_to_response("list_stats.html", {"form":form})
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    97
    else:
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    98
        form = SearchForm()
f79be1dd4a22 added clean methods for each attribute in search form
nishanth
parents: 23
diff changeset
    99
        return render_to_response("list_stats.html", {"form":form})
26
212fcba4459e changed the app to work with apache + added base.html, and did needed changes.
anoop
parents: 25
diff changeset
   100
65
0ca63c964237 now login is required for accessing stats and send_invi pages
nishanth
parents: 57
diff changeset
   101
@login_required
56
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   102
def send_invi(request):
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   103
    """ Take a list of csv email addresses and send mails to them.
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   104
    """
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   105
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   106
    if request.method == "POST":
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   107
        form = EmailForm(request.POST)
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   108
        if form.is_valid():
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   109
            to_emails = form.cleaned_data['emails']
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   110
            mail_invi(to_emails)
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   111
            return render_to_response("send_invi.html", {"emails":to_emails})
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   112
        else:
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   113
            return render_to_response("send_invi.html", {"form":form})
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   114
    else:
57
03150449a049 fixed a bug
nishanth
parents: 56
diff changeset
   115
        form = EmailForm()
56
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   116
        return render_to_response("send_invi.html", {"form":form})
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   117
86
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   118
@login_required
246
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   119
def send_cust_invi(request):
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   120
    """ Take a list of csv email addresses and send mails to them.
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   121
    """
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   122
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   123
    if request.method == "POST":
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   124
        form = EmailForm(request.POST)
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   125
        if form.is_valid():
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   126
            to_emails = form.cleaned_data['emails']
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   127
            mail_cust_invi(to_emails)
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   128
            return render_to_response("send_cust_invi.html", {"emails":to_emails})
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   129
        else:
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   130
            return render_to_response("send_cust_invi.html", {"form":form})
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   131
    else:
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   132
        form = EmailForm()
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   133
        return render_to_response("send_cust_invi.html", {"form":form})
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   134
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   135
3a32df4b3171 added custom invitation mail page.
Anoop Jacob Thomas<anoop@fossee.in>
parents: 242
diff changeset
   136
@login_required
86
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   137
def send_workshop_confirm(request):
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   138
    """ Show a list of all the ppl who requested for a workshop and 
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   139
    send a confirmation mail to them if not sent.
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   140
    """
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   141
160
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   142
    not_selected_ppl = Registrant.objects.filter(need_for_python_workshop=True, registrantinfo__status_of_attending_workshop="1")
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   143
    not_confirmed_ppl = Registrant.objects.filter(need_for_python_workshop=True, registrantinfo__status_of_attending_workshop="2")
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   144
    attending_ppl = Registrant.objects.filter(need_for_python_workshop=True, registrantinfo__status_of_attending_workshop="3")
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   145
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   146
    choices = list(not_selected_ppl) + list(not_confirmed_ppl)
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   147
    form = UserSelectForm(choices, request.POST)
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   148
    if request.method == "POST" and form.is_valid():
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   149
        selected_users = form.cleaned_data['selected_users']
161
c7c5c727a483 removed old template and copied send_sgd_cnf as send_wsp_cnf since both are same and fixed a bug in view
nishanth
parents: 160
diff changeset
   150
        for user in selected_users:
160
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   151
            user_info = user.registrantinfo_set.all()[0]
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   152
            user_info.status_of_attending_workshop = "2"
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   153
            user_info.save()
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   154
162
27dd4494e7b4 created the mail event and added it in view for send_wsp_ptc
nishanhth
parents: 161
diff changeset
   155
        send_wsp_ptc_confirm(user)
27dd4494e7b4 created the mail event and added it in view for send_wsp_ptc
nishanhth
parents: 161
diff changeset
   156
160
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   157
        return render_to_response("sent_wsp_confirm.html", {"selected_users":selected_users})
86
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   158
    else:
160
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   159
        return render_to_response("send_wsp_cnf.html", {"attending": attending_ppl,
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   160
                                                        "not_confirmed": not_confirmed_ppl,
2f01af211af9 updated the view to look like send_sgd_cnf
nishanth
parents: 159
diff changeset
   161
                                                        "not_selected": not_selected_ppl,})
86
1f0be76a18fc added a view for sending confirmation for workshop
nishanth
parents: 84
diff changeset
   162
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   163
@login_required
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   164
def send_sagedays_confirm(request):
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   165
    """ filter out ppl depending on their status and display accordingly.
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   166
    """
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   167
146
a18ba6b30c43 fixed a bug in views
nishanth
parents: 144
diff changeset
   168
    attending_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="3")
a18ba6b30c43 fixed a bug in views
nishanth
parents: 144
diff changeset
   169
    not_confirmed_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="2")
a18ba6b30c43 fixed a bug in views
nishanth
parents: 144
diff changeset
   170
    not_selected_ppl = Registrant.objects.filter(registrantinfo__status_of_attending_sagedays ="1")
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   171
115
c03a2b66ea09 fixed a bug
nishanth
parents: 114
diff changeset
   172
    user_choices = list(not_selected_ppl) + list(not_confirmed_ppl)
182
27e0bc9425a2 fixed a bug
nishanth
parents: 179
diff changeset
   173
    form = UserSelectForm(user_choices, request.POST)
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   174
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   175
    if request.method == "POST" and form.is_valid():
112
3cf5f668fca5 implemented the post part to an extent
nishanth
parents: 111
diff changeset
   176
        selected_users = form.cleaned_data['selected_users']
114
aa5c29984e84 now the send_sgd_cnf view does the updating of user record
nishanth
parents: 113
diff changeset
   177
        for user in selected_users:
117
af9472ab8f3e fixed a typo
nishanth
parents: 116
diff changeset
   178
            user_info = user.registrantinfo_set.all()[0]
114
aa5c29984e84 now the send_sgd_cnf view does the updating of user record
nishanth
parents: 113
diff changeset
   179
            user_info.status_of_attending_sagedays = "2"
aa5c29984e84 now the send_sgd_cnf view does the updating of user record
nishanth
parents: 113
diff changeset
   180
            user_info.save()
118
6c3602582f9f included the send_mail and created the corresponding event in events
nishanth
parents: 117
diff changeset
   181
137
02a5304a2c5f fixed a typo and corrected at various places accordingly
nishanth
parents: 136
diff changeset
   182
            send_sgd_ptc_confirm(user)
114
aa5c29984e84 now the send_sgd_cnf view does the updating of user record
nishanth
parents: 113
diff changeset
   183
        
116
54ced1b9e010 fixed a typo and added new template for confirmation of sending mail to selected participants
nishanth
parents: 115
diff changeset
   184
        return render_to_response("sent_sgd_confirm.html", {"selected_users":selected_users})
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   185
    else:
111
45f844723b7a fixed a bug
nishanth
parents: 110
diff changeset
   186
        return render_to_response("send_sgd_cnf.html", {"attending":attending_ppl, 
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   187
                                                "not_confirmed":not_confirmed_ppl,
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   188
                                                "not_selected":not_selected_ppl,
110
01b5184402c8 fixed a bug
nishanth
parents: 108
diff changeset
   189
                                               })
108
9363e5121f9b added the GET part of view for sending event confirmation emails
nishanth
parents: 107
diff changeset
   190
174
d979d1bc1c4e removed "2" from acco_choices and made corresponding change in view
nishanth
parents: 172
diff changeset
   191
@login_required
152
86bfdb64edb5 created basic view for sending acco and added corresponding url
nishanth
parents: 151
diff changeset
   192
def send_acco_confirm(request):
86bfdb64edb5 created basic view for sending acco and added corresponding url
nishanth
parents: 151
diff changeset
   193
    """ display list of confirmed participants who requested for accomodation
86bfdb64edb5 created basic view for sending acco and added corresponding url
nishanth
parents: 151
diff changeset
   194
    and let the admin decide.
86bfdb64edb5 created basic view for sending acco and added corresponding url
nishanth
parents: 151
diff changeset
   195
    """
153
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   196
214
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   197
    rejected_ppl = Registrant.objects.filter(
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   198
        registrantinfo__status_of_attending_sagedays ="3", 
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   199
        registrantinfo__status_of_accomodation="3")
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   200
    selected_ppl = Registrant.objects.filter(
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   201
        registrantinfo__status_of_attending_sagedays ="3", 
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   202
        registrantinfo__status_of_accomodation="2")
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   203
    not_selected_ppl = Registrant.objects.filter(
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   204
        registrantinfo__status_of_attending_sagedays ="3", 
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   205
        registrantinfo__status_of_accomodation="1")
153
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   206
186
a88fe014f9eb fixed a small typo
nishanth
parents: 185
diff changeset
   207
    user_choices = list(rejected_ppl) + list(not_selected_ppl)
182
27e0bc9425a2 fixed a bug
nishanth
parents: 179
diff changeset
   208
    form = SendAccoForm(user_choices, request.POST)
153
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   209
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   210
    if request.method == "POST" and form.is_valid():
156
cebb6ffb5f83 created the POST part of view. hav to implement the sending email part
nishanth
parents: 155
diff changeset
   211
        selected_users = form.cleaned_data['selected_users']
184
21ec3fa1d372 fixed a bug
nishanth
parents: 183
diff changeset
   212
        message = form.cleaned_data['message']
156
cebb6ffb5f83 created the POST part of view. hav to implement the sending email part
nishanth
parents: 155
diff changeset
   213
        for user in selected_users:
cebb6ffb5f83 created the POST part of view. hav to implement the sending email part
nishanth
parents: 155
diff changeset
   214
            user_info = user.registrantinfo_set.all()[0]
183
3603ee3de179 fixed a typo
nishanth
parents: 182
diff changeset
   215
            user_info.status_of_accomodation = "3"
156
cebb6ffb5f83 created the POST part of view. hav to implement the sending email part
nishanth
parents: 155
diff changeset
   216
            user_info.save()
214
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   217
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   218
        send_acco_confirm_mail(user, message)
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   219
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   220
        return render_to_response("sent_acco_confirm.html",
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   221
                                  {"selected_users":selected_users})
153
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   222
    else:
214
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   223
        return render_to_response("send_acco_cnf.html",
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   224
                                  {"rejected": rejected_ppl,
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   225
                                   "selected":selected_ppl,
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   226
                                   "not_selected":not_selected_ppl,
e76c56790872 Made style changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 211
diff changeset
   227
                                  })
153
55f338569133 updated the view for GET part and created corresponding template
nishanth
parents: 152
diff changeset
   228
95
ab554d46fd34 created basic view for confirmation of wsp participation
nishanth
parents: 93
diff changeset
   229
def confirm_wsp_participation(request, uid):
ab554d46fd34 created basic view for confirmation of wsp participation
nishanth
parents: 93
diff changeset
   230
    """ match id versus email and take lappy details.
ab554d46fd34 created basic view for confirmation of wsp participation
nishanth
parents: 93
diff changeset
   231
    """
193
9b2a63bb8d16 made neccesary changes to cancel python workshop.
anoop
parents: 186
diff changeset
   232
    return render_to_response("workshop_info.html")
95
ab554d46fd34 created basic view for confirmation of wsp participation
nishanth
parents: 93
diff changeset
   233
120
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   234
def confirm_sgd_participation(request, uid):
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   235
    """ match id versus email and take lappy details.
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   236
    """
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   237
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   238
    try:
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   239
        email = request.GET['email']
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   240
    except MultiValueDictKeyError:
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   241
        raise Http404
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   242
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   243
    try:
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   244
        user = Registrant.objects.get(id=uid, email=email)
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   245
    except Registrant.DoesNotExist:
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   246
        raise Http404
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   247
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   248
    user_info = user.registrantinfo_set.all()[0]
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   249
    status = user_info.status_of_attending_sagedays
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   250
    if status == "3":
139
7eaaecef80f6 replaced acco_required with user.acco_required in template and made change accordingly
nishanth
parents: 138
diff changeset
   251
        return render_to_response("attending_sgd.html", {"user":user})
123
dd1a4022d5b1 fixed a typo
nishanth
parents: 122
diff changeset
   252
    elif status != "2":
120
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   253
        raise Http404
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   254
225
a942039ded62 added a new exception.
anoop
parents: 223
diff changeset
   255
    special_request = [150,151,175,195,189,190]
210
9dde8b1de561 barred unconfirmed people from confirming, and added one more exception/special request.
anoop
parents: 206
diff changeset
   256
    if int(uid) < 229 and int(uid) not in special_request:
201
e272a7fcdbaa late confirmations will be redirected to a new page.
anoop
parents: 193
diff changeset
   257
        return render_to_response("late_for_confirmation.html", {"user":user})
e272a7fcdbaa late confirmations will be redirected to a new page.
anoop
parents: 193
diff changeset
   258
124
d4a7644e7fe8 created a form for taking participant info and used it in the view
nishanth
parents: 123
diff changeset
   259
    participant_info = ParticipantInfo()
d4a7644e7fe8 created a form for taking participant info and used it in the view
nishanth
parents: 123
diff changeset
   260
    participant_info.participant = user
d4a7644e7fe8 created a form for taking participant info and used it in the view
nishanth
parents: 123
diff changeset
   261
128
16b3557b4260 added the new object creation to the view
nishanth
parents: 126
diff changeset
   262
    form = ParticipantInfoForm(request.POST)
16b3557b4260 added the new object creation to the view
nishanth
parents: 126
diff changeset
   263
    if request.method == "POST" and form.is_valid():
16b3557b4260 added the new object creation to the view
nishanth
parents: 126
diff changeset
   264
        data = form.cleaned_data
130
384049c3bcb8 fixed a typo
nishanth
parents: 129
diff changeset
   265
        participant_info.has_laptop_for_sagedays = True if data['has_laptop_for_sagedays'] == "Yes" else False
128
16b3557b4260 added the new object creation to the view
nishanth
parents: 126
diff changeset
   266
        participant_info.sprinted_already = True if data['sprinted_already'] == "Yes" else False
16b3557b4260 added the new object creation to the view
nishanth
parents: 126
diff changeset
   267
        participant_info.will_sprint = data['will_sprint']
129
b5dfde8e43a9 fixed a typo and improvised the view
nishanth
parents: 128
diff changeset
   268
        participant_info.save()
b5dfde8e43a9 fixed a typo and improvised the view
nishanth
parents: 128
diff changeset
   269
b5dfde8e43a9 fixed a typo and improvised the view
nishanth
parents: 128
diff changeset
   270
        user_info.status_of_attending_sagedays = "3"
b5dfde8e43a9 fixed a typo and improvised the view
nishanth
parents: 128
diff changeset
   271
        user_info.save()
b5dfde8e43a9 fixed a typo and improvised the view
nishanth
parents: 128
diff changeset
   272
151
c5915459e48b uncommented the sending email thingy
nishanth
parents: 149
diff changeset
   273
        send_cnf_email(user)
149
1f53ccd82a21 included the send_cnf_email event in views but right now, it is commented
nishanth
parents: 148
diff changeset
   274
139
7eaaecef80f6 replaced acco_required with user.acco_required in template and made change accordingly
nishanth
parents: 138
diff changeset
   275
        return render_to_response("attending_sgd.html", {"user":user})
120
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   276
    else:
126
98eb8dc364ba now form is not rendered via form.as_p
nishanth
parents: 125
diff changeset
   277
        return render_to_response("cnf_sgd_ptc.html", {"user":user})
120
f9408ab30ace created the basic view and template for confirming participation in sage days
nishanth
parents: 118
diff changeset
   278
236
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   279
def confirm_address(request, uid):
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   280
    """ match id versus email and let him edit the address
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   281
    """
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   282
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   283
    try:
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   284
        email = request.GET['email']
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   285
    except MultiValueDictKeyError:
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   286
        raise Http404
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   287
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   288
    try:
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   289
        user = Registrant.objects.get(id=uid, email=email)
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   290
    except Registrant.DoesNotExist:
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   291
        raise Http404
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   292
242
6826f27064c9 fixed a bug
nishanth
parents: 239
diff changeset
   293
    if request.method == "POST":
239
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   294
        form = EditAddressForm(request.POST, instance=user)
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   295
        if form.is_valid():
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   296
            form.save()
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   297
            #send_addr_upd_email(user)
242
6826f27064c9 fixed a bug
nishanth
parents: 239
diff changeset
   298
            return render_to_response("address_updated.html", {"user":user})
239
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   299
        else:
242
6826f27064c9 fixed a bug
nishanth
parents: 239
diff changeset
   300
            return render_to_response("update_address.html", {"user":user, 'form':form})
236
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   301
    else:
242
6826f27064c9 fixed a bug
nishanth
parents: 239
diff changeset
   302
        form = EditAddressForm(instance=user)
239
b706790a1001 updated the view
nishanth
parents: 236
diff changeset
   303
        return render_to_response("update_address.html", {"user":user, 'form':form})
236
af8cee5a0a27 created a view to edit and update address
nishanth
parents: 225
diff changeset
   304
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   305
def admin_login(request):
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   306
    """ basic login.
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   307
    """
56
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   308
72
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   309
    redirect_url = "/%s/registration/stats"%aup
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   310
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   311
    user = request.user
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   312
    if user.is_authenticated():
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   313
        return redirect(redirect_url)
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   314
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   315
    if request.method == "POST":
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   316
        form = LoginForm(request.POST)
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   317
        if form.is_valid():
72
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   318
            data = form.cleaned_data
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   319
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   320
            username = data['username']
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   321
            password = data['password']
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   322
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   323
            user = authenticate(username=username, password=password)
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   324
            login(request, user)
72
3673ed3ca27c fixed a few bugs
nishanth
parents: 70
diff changeset
   325
            return redirect(redirect_url)
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   326
        else:
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   327
            return render_to_response("login.html", {"form":form})
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   328
    else:
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   329
        form = LoginForm()
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   330
        return render_to_response("login.html", {"form":form})
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   331
70
58cafee2ee89 now only logged in users can logout
nishanth
parents: 67
diff changeset
   332
@login_required
67
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   333
def admin_logout(request):
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   334
    """ simply logout.
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   335
    """
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   336
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   337
    logout(request)
b9690fbf78af created views for login and logout
nishanth
parents: 65
diff changeset
   338
    return render_to_response("logout.html")
56
7dfacad8adee provided an interface for sending out emails
nishanth
parents: 53
diff changeset
   339
26
212fcba4459e changed the app to work with apache + added base.html, and did needed changes.
anoop
parents: 25
diff changeset
   340
def homepage(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   341
    return render_to_response("index.html")
26
212fcba4459e changed the app to work with apache + added base.html, and did needed changes.
anoop
parents: 25
diff changeset
   342
31
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   343
def schedule(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   344
    return render_to_response("schedule.html")
31
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   345
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   346
def organizers(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   347
    return render_to_response("organizers.html")
31
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   348
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   349
def venue(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   350
    return render_to_response("about_venue.html")
31
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   351
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   352
def contact(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   353
    return render_to_response("contact.html")
31
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   354
ec540dfbfe78 added more pages.
anoop
parents: 26
diff changeset
   355
def about(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   356
    return render_to_response("about.html")
48
a3e6f9470549 made some changes to links and added accomodation page.
anoop
parents: 31
diff changeset
   357
	
a3e6f9470549 made some changes to links and added accomodation page.
anoop
parents: 31
diff changeset
   358
def accomodation(request):
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   359
    return render_to_response("accomodation.html")
84
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   360
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   361
def about_mumbai(request):
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   362
    return render_to_response("about_mumbai.html")
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   363
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   364
def reaching_iitb(request):
7007ec492eac added more information about venue.
anoop
parents: 80
diff changeset
   365
    return render_to_response("reaching_iitb.html")
91
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   366
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   367
def talks_proposed(request):
9fab907060a7 added talks proposed page.
anoop
parents: 85
diff changeset
   368
    return render_to_response("talks_proposed.html")
143
a752dc99e23c added link to sprint_info and created a basic template
nishanth
parents: 139
diff changeset
   369
a752dc99e23c added link to sprint_info and created a basic template
nishanth
parents: 139
diff changeset
   370
def sprint_info(request):
a752dc99e23c added link to sprint_info and created a basic template
nishanth
parents: 139
diff changeset
   371
    """ display info on what a sprint is.
a752dc99e23c added link to sprint_info and created a basic template
nishanth
parents: 139
diff changeset
   372
    """
a752dc99e23c added link to sprint_info and created a basic template
nishanth
parents: 139
diff changeset
   373
144
cb81b0f7e707 ixed a bug
nishanth
parents: 143
diff changeset
   374
    return render_to_response("sprint_info.html")
172
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   375
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   376
def workshop_info(request):
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   377
    """ disply info on workshop
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   378
    """
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   379
32c2b57c45f8 created view for displaying workshop info
nishanth
parents: 162
diff changeset
   380
    return render_to_response("workshop_info.html")