Closed GoogleCodeExporter closed 9 years ago
Seems that the FormWithSets is more broken than this - when you submit a form
with an
empty (but required) field, instead of rendering the field with an error
message, it
returns the form with the field removed.
Original comment by tommytastic
on 24 Apr 2009 at 11:19
I've fixed the first issue.
The second behavior is expected. The admin interface works the same. When all
required fields are empty the form assumes that the user didn't want to enter
any
data. Otherwise there would be no way of knowing whether the user actually
wanted
create such an entity or not.
Original comment by wkornew...@gmail.com
on 25 Apr 2009 at 8:58
The form I have is a bit like this:
class MyForm(ModelForm):
myfield = fields.CharField(required=True)
relatedItems = FormSetField(RelatedItem)
MyForm = FormWithSets(MyForm)
I then display the form for editing and fill in some relatedItems. If I forget
to
enter anything in myfield when the form is reshown, the field has been removed,
so I
cannot correct my mistake.
Original comment by tommytastic
on 25 Apr 2009 at 12:14
On http://aep-sample.appspot.com it works as expected. If I forget to enter a
"Last
name", but select some employee I get an error for the missing "Last name", but
all
entered values ("First name" and "Employee") stay unmodified. No fields get
lost,
there's nothing wrong that I can see. Can you reproduce it on the sample
project's
website?
Original comment by wkornew...@gmail.com
on 26 Apr 2009 at 10:20
Original issue reported on code.google.com by
tommytastic
on 24 Apr 2009 at 9:58