now the text area is displayed in a more elegant way
authorNishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 20:25:05 +0530
changeset 319 70726699ca80
parent 318 49ee2a7f1350
child 320 285320d3063c
now the text area is displayed in a more elegant way
pytask/profile/forms.py
pytask/templates/registration/registration_form.html
--- a/pytask/profile/forms.py	Sat Jan 08 15:13:56 2011 +0530
+++ b/pytask/profile/forms.py	Sat Jan 08 20:25:05 2011 +0530
@@ -18,7 +18,8 @@
                                 help_text="Any DD/Cheque will be issued on \
                                            this name")
 
-    aboutme = forms.CharField(required=True, max_length=1000, label=u"About Me",
+    aboutme = forms.CharField(required=True, widget=forms.Textarea, 
+                              max_length=1000, label=u"About Me",
                               help_text="A write up about yourself to aid the\
                               reviewer in judging your eligibility for a task.\
                               It can have your educational background, CGPA,\
@@ -29,8 +30,9 @@
     dob = forms.DateField(help_text = "YYYY-MM-DD", required=True, label=u'date of birth')
     gender = forms.ChoiceField(choices = GENDER_CHOICES, required=True, label=u'gender')
 
-    address = forms.CharField(required=True, max_length=200, help_text="This \
-                             information will be used while sending DD/Cheque")
+    address = forms.CharField(required=True, max_length=200,
+                              widget=forms.Textarea, help_text="This \
+                              information will be used while sending DD/Cheque")
     phonenum = forms.CharField(required=True, max_length=10, 
                                label="Phone Number")
 
--- a/pytask/templates/registration/registration_form.html	Sat Jan 08 15:13:56 2011 +0530
+++ b/pytask/templates/registration/registration_form.html	Sat Jan 08 20:25:05 2011 +0530
@@ -2,27 +2,7 @@
 {% block content %}
 <form action="/accounts/register/" method="post">
 {% csrf_token %}
-<p><label for="id_username">Username:</label> <input id="id_username" type="text" class="required" name="username" maxlength="30" /></p>
-<p><label for="id_email">Email address:</label> <input id="id_email" type="text" class="required" name="email" maxlength="75" /></p>
-<p><label for="id_password1">Password:</label> <input id="id_password1" type="password" class="required" name="password1" /></p>
-<p><label for="id_password2">Password (again):</label> <input id="id_password2" type="password" class="required" name="password2" /></p>
-<p><label for="id_full_name">Name as on your bank account:</label> <input id="id_full_name" type="text" name="full_name" maxlength="50" /> Any DD/Cheque will be issued on this name</p>
-
-<p><label for="id_aboutme">About Me:</label>
-<textarea id="id_aboutme" rows="10" cols="40" name="aboutme"></textarea>
-A write up about yourself to aid the reviewer in judging your eligibility for a task. 
-It can have your educational background, CGPA, field of interests etc.,</p>
-
-<p><label for="id_dob">date of birth:</label> <input type="text" name="dob" id="id_dob" /> YYYY-MM-DD</p>
-<p><label for="id_gender">gender:</label> <select name="gender" id="id_gender">
-	<option value="M">Male</option>
-	<option value="F">Female</option>
-
-</select></p>
-<p><label for="id_address">Address:</label>
-<textarea id="id_address" rows="10" cols="40" name="address"></textarea>
-This information will be used while sending DD/Cheque</p>
-<p><label for="id_phonenum">Phone Number:</label> <input id="id_phonenum" type="text" name="phonenum" maxlength="10" /></p>
+{{ form.as_p }}
 <input type="submit" value="Submit" />
 </form>
 {% endblock %}