﻿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
28326	Allow providing initial data in ModelForm Meta	Luoxzhg	nobody	"Now, we can specify 'widgets', 'labels', and so on in ModelForm's Meta innerclass and modelform_factory. But We can't specify 'initials' in Meta and modelform_factory. We must provide initial values in explicitly defined fields or in ModelForm instantiation.

{{{
class Person(models.Model):
    first = models.CharField(max_length=10)
    last = models.CharField(max_length=10)

class PersonForm(forms.ModelForm):
    last = forms.CharField(max_length=10, required=True, initial=""Smith"")
    class Meta:
        model = Person
        fields = '__all__'
}}}

If we can specify initial values in Meta, it is easier to specify initial values:

{{{
class PersonForm(forms.ModelForm):
    class Meta:
         model = Person
         fields = '__all__'
         initials = {'last': 'Smith'}
}}}
"	New feature	closed	Forms	1.11	Normal	wontfix	ModelForm, Meta, initials, modelform_factory		Unreviewed	0	0	0	0	0	0
