Code

Opened 7 years ago

Closed 7 years ago

#3120 closed defect (invalid)

In newforms, textarea does not get rendered with form

Reported by: djangotrac2@… Owned by: adrian
Component: Forms Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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>'

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by gpd@…

  • Resolution set to invalid
  • Status changed from new to closed

This is not a bug. Textarea is a widget not a field. You would need to say:

field2 = CharField(widget=Textarea)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.