Closed brew closed 11 years ago
I will try to investigate it in the coming days but it would be really good if you could provide at least a unit test to make things easier.
As it's quite specific to the interaction with the admin interface, I'm not sure how best to write a unittest for it. I can zip up the toy project I made for it, if that would help?
Fixed in 7cb34f8b0986f3330ba1af397a1795e9e2fc2820 and released as 0.2.3
I have Parent and Child models in myapp/models.py. The MyChild model has a PriceField field:
And in myapp/admin.py, the child models are inline:
If I attempt to add a Parent using the admin, by filling the Parent's name field, but leaving the three child forms untouched, I get errors because the three empty children are also being submitted.
(In fact, if MyChild.name was able to validate, either having its own default value, or blank=True parameter, the form would submit successfully and three MyChild instances would be saved to the database. Three new MyChild instances would be created each time the Parent instance is saved using the admin.)
This is triggered by the presence of the
default
parameter of the MyChild.price_offset field. If I remove the default, I can submit without an attempt to create child instances.