﻿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
21474	ModelForm resets field when field not in data	Mike Wyatt (wyatt.mike@…	nobody	"After reading ""Don't assume that missing fields from POST data are equal to an empty string value"" (https://groups.google.com/forum/#!topic/django-developers/w8UKCLjOMpg), I still don't get how something like:

{{{
profile = Profile.objects.create(first_name='Tai', last_name='Lee',
address='Sydney')
form = ProfileForm({}, instance=profile)
if form.is_valid():
    form.save()
}}}

clearing the existing fields on the form could be seen as intuitive. Or how the Django co-creator Adrian Holovaty advises against using ModelForms, something included in his framework.

My case is I've a `published_at` field on a model, and when the form is submitted, that field is reset. I would expect it to stay the same.

Sure, there's the `fields` and `exclude` properties of the Meta class, but things can still be mass-assigned via POST. Maybe take a page from other frameworks that worked around this issue years ago?

I should mention this issue stems from using django-crispy-forms, where I've never really had to use those properties on the form's meta class, where one can easily design a form as they want, and are not limited to tables or unordered lists."	Uncategorized	closed	Forms	dev	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
