﻿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
24295	Allow specifying form field types in a ModelForm's Meta	Loic Bistuer	Loic Bistuer	"It's currently very fiddly to use a custom form field together with `ModelForm`.

You can either set the field declaratively, which requires redefining all the attributes that would be automatically pulled from the model. It is not very DRY and quite error-prone, especially when it comes to `required` / `blank`. Or you can abuse `models.Field.formfield` by doing: `my_field = MyModel._meta.get_field('my_field').formfield(form_class=MyCustomField)`.

This ticket proposes allowing:

{{{
class ArticleForm(ModelForm):
    class Meta:
        model = Article
        fields = ['pub_date', 'headline', 'content', 'reporter', 'slug']
        field_classes = {
            'slug': MySlugFormField,
        }
}}}
"	New feature	closed	Forms	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
