--- a/sdi/forms.py Sat Jul 17 01:08:40 2010 +0530
+++ b/sdi/forms.py Sat Jul 17 01:14:36 2010 +0530
@@ -1,7 +1,7 @@
from django import forms
from django.contrib.auth import authenticate
-from sage_days.sdi.models import Registrant, TOPICS_CHOICES
+from sage_days.sdi.models import Registrant, TOPICS_CHOICES, ParticipantInfo
from captcha.fields import CaptchaField
class RegisterForm(forms.ModelForm):
@@ -181,3 +181,8 @@
return myF(post_data) if post_data else myF()
+class ParticipantInfoForm(forms.ModelForm):
+
+ class Meta:
+ model = ParticipantInfo
+ exclude = ['participant']
--- a/sdi/views.py Sat Jul 17 01:08:40 2010 +0530
+++ b/sdi/views.py Sat Jul 17 01:14:36 2010 +0530
@@ -6,7 +6,7 @@
from django.contrib.auth import authenticate, login, logout
from sage_days.sdi.models import Registrant, RegistrantInfo, ParticipantInfo
-from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm
+from sage_days.sdi.forms import RegisterForm, SearchForm, EmailForm, LoginForm, UserSelectForm, ParticipantInfoForm
from sage_days.sdi.events import send_reg_complete_mail, mail_invi, send_wsp_ptc_confirm
from sage_days.settings import APACHE_URL_PREFIX as aup
@@ -209,11 +209,13 @@
elif status != "2":
raise Http404
+ participant_info = ParticipantInfo()
+ participant_info.participant = user
+
if request.method == "POST":
- participant_info = ParticipantInfo()
- participant_info.participant = user
- participant_info.save()
+ pass
else:
+ form = ParticipantInfoForm(instance=participant_info)
return render_to_response("cnf_sgd_ptc.html", {"user":user})