﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13269	"""Overriding the default widgets"" docs missing import statement"	Matthew Rowbottom	Gabriel Hurley	"Hi.

I'm new to django and am using the development version from SVN v1.2.0 beta.1 (rev 12909)

I am unsure of whether there is a problem in the code, docs or my own app. I'm providing this as a solution to a problem I faced, based on information found in the docs.

The first example given in the following section of the docs would not work for me...
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-default-field-types-or-widgets

{{{
class AuthorForm(ModelForm):
    class Meta:
        model = Author
        fields = ['name', 'title', 'birth_date']
        widgets = {
            'name': Textarea(attrs={'cols': 80, 'rows': 20}),
        }
}}}

From reading through the docs, I presume that the only import required is:

{{{
from django.forms import ModelForm
}}}

When I attempted to run the development server, I receive the following error message:
{{{
NameError: name 'Textarea' is not defined
}}}

My solution was the following:

{{{
from django import forms

class AuthorForm(forms.ModelForm):
    class Meta:
        model = Author
        fields = ['name', 'title', 'birth_date']
        widgets = {
            'name': forms.Textarea(attrs={'cols': 80, 'rows': 20}),
        }
}}}

In summary, I made the following changes:

{{{
Line 1 - from django import forms
Line 3 - class AuthorForm(forms.ModelForm):
Line 8 - 'name': forms.Textarea(...),
}}}

I hope this is of some help."		closed	Documentation	1.2-beta		fixed	widgets, form field types		Ready for checkin	1	0	0	0	0	0
