summaryrefslogtreecommitdiff
path: root/workshop_app/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'workshop_app/forms.py')
-rw-r--r--workshop_app/forms.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/workshop_app/forms.py b/workshop_app/forms.py
index cce6dfc..81eef79 100644
--- a/workshop_app/forms.py
+++ b/workshop_app/forms.py
@@ -37,6 +37,28 @@ department_choices = (
("others", "Others"),
)
+title = (
+ ("Professor", "Prof."),
+ ("Doctor", "Dr."),
+ ("Shriman", "Shri"),
+ ("Shrimati", "Smt"),
+ ("Kumari", "Ku"),
+ ("Mr", "Mr."),
+ ("Mrs", "Mrs."),
+ ("Miss", "Ms."),
+ ("other", "Other"),
+ )
+
+source = (
+ ("FOSSEE Email", "FOSSEE Email"),
+ ("FOSSEE website", "FOSSEE website"),
+ ("Google", "Google"),
+ ("Social Media", "Social Media"),
+ ("From other College", "From other College"),
+ ("Others", "Others"),
+ )
+
+
class UserRegistrationForm(forms.Form):
"""A Class to create new form for User's Registration.
It has the various fields and functions required to register
@@ -49,6 +71,7 @@ class UserRegistrationForm(forms.Form):
password = forms.CharField(max_length=32, widget=forms.PasswordInput())
confirm_password = forms.CharField\
(max_length=32, widget=forms.PasswordInput())
+ title = forms.ChoiceField(choices=title)
first_name = forms.CharField(max_length=32)
last_name = forms.CharField(max_length=32)
phone_number = forms.RegexField(regex=r'^.{10}$',
@@ -59,7 +82,8 @@ class UserRegistrationForm(forms.Form):
help_text='Please write full name of your Institute/Organization')
department = forms.ChoiceField(help_text='Department you work/study',
choices=department_choices)
-
+ location = forms.CharField(max_length=255, help_text="Place/City")
+ source = forms.ChoiceField(choices=source)
def clean_username(self):
u_name = self.cleaned_data["username"]
@@ -110,6 +134,9 @@ class UserRegistrationForm(forms.Form):
new_profile.department = cleaned_data["department"]
#new_profile.position = cleaned_data["position"]
new_profile.phone_number = cleaned_data["phone_number"]
+ new_profile.location = cleaned_data["location"]
+ new_profile.title = cleaned_data["title"]
+ new_profile.source = cleaned_data["source"]
new_profile.activation_key = generate_activation_key(new_user.username)
new_profile.key_expiry_time = timezone.now() + \
timezone.timedelta(days=1)
@@ -190,13 +217,11 @@ class ProposeWorkshopDateForm(forms.ModelForm):
self.fields['proposed_workshop_title'].label = "Workshop :"
self.fields['proposed_workshop_date'].label = "Workshop Date :"
-
class Meta:
model = ProposeWorkshopDate
exclude = ['status', 'proposed_workshop_instructor',
'proposed_workshop_coordinator']
widgets = {
'proposed_workshop_date': forms.DateInput(attrs={
- 'class':'datepicker'}),
- }
-
+ 'class':'datepicker'})
+ } \ No newline at end of file