Opened 18 years ago
Closed 18 years ago
#3120 closed defect (invalid)
In newforms, textarea does not get rendered with form
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I am creating a form with a textarea, but the textarea does not get rendered along with the form. I apologize if the problem is due to my ignorance of newforms; I am just starting to learn about it.
This is on an svn checkout from about 3 hours ago (Dec 9 2006 around 10:00AM EST)
%python2.4 manage.py shell
Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
import django.newforms as newforms
from django.template import Template, Context
class MyForm(newforms.Form):
... field1 = newforms.CharField()
... field2 = newforms.Textarea()
...
t = Template('{{f}}')
t.render(Context({'f': MyForm()}))
'<tr><td>Field1:</td><td><input type="text" name="field1" /></td></tr>'
This is not a bug. Textarea is a widget not a field. You would need to say:
field2 = CharField(widget=Textarea)