﻿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
15725	No easy way to get default model values into a ModelForm for validation	Mark Jones	nobody	"I have a Django modelForm that excludes some model fields so that when it is used on a web page, those fields are available. I'd like to use the same modelForm object on an API.

When I use the form on a webpage, the rendering of the form takes into account the default values of the model Field, the form is rendered and the submitted ""final"" form contains those values. Similarly I can do the same thing with an initial dict passed to the form during creation.

Problem is, when you expose a modelForm via an API there is no initial rendering of the default values to cause them to show up in the final submitted form. What this results in is is_valid returning false because the form ""requires"" fields that would have been filled in with their default values via the initial rendering of the form.

I've covered it all here with a possible fix:

http://stackoverflow.com/questions/5491452/how-to-get-model-default-values-into-django-form-so-that-is-valid-returns-true/5492397#5492397"	New feature	new	Forms	1.2	Normal			Tom Christie Sergey Fedoseev	Accepted	0	0	0	0	0	0
