no newforms.TextField() available?!?!?

5 views
Skip to first unread message

Jens Diemer

unread,
Jun 25, 2007, 9:11:19 AM6/25/07
to django...@googlegroups.com

I would like to use the newforms.TextField() to make a html textarea. But i get
the error:
'module' object has no attribute 'TextField'

I wounder, because in the Docu i find TextField unter field types list:
http://www.djangoproject.com/documentation/newforms/#field-types

my code:
--------------------------------------------------------------------------
from django import newforms as forms

class MailForm(forms.Form):
...
mail_text = forms.TextField()
...
--------------------------------------------------------------------------

This works:
mail_text = forms.CharField(widget=forms.Textarea)


Note: I used the unicode-branch.


--
Mfg.

Jens Diemer


----
A django powered CMS: http://www.pylucid.org

James Bennett

unread,
Jun 25, 2007, 9:48:34 AM6/25/07
to django...@googlegroups.com
On 6/25/07, Jens Diemer <python...@jensdiemer.de> wrote:
> This works:
> mail_text = forms.CharField(widget=forms.Textarea)

That's by design. Whether to show an input type="text" or a textarea
is a matter of widgets, so you differentiate between them by using
different widgets.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Jens Diemer

unread,
Jun 26, 2007, 1:32:39 AM6/26/07
to django...@googlegroups.com
James Bennett schrieb:

> On 6/25/07, Jens Diemer <python...@jensdiemer.de> wrote:
>> This works:
>> mail_text = forms.CharField(widget=forms.Textarea)
>
> That's by design. Whether to show an input type="text" or a textarea
> is a matter of widgets, so you differentiate between them by using
> different widgets.
>

Thanks for the info ;)

Reply all
Reply to author
Forward
0 new messages