|
|
|
|
|
by dematz
518 days ago
|
|
The low javascript django approach definitely appeals when starting a project, but I'm trying it and feel like I hit an awkward patch very quickly: submitting nested forms. For example, an Allergy can have many Reactions, a Reaction can have many Manifestations. The form layout looks like it should capture which Reaction a Manifestation has a foreign key on: Allergy -Reaction 1 --Manifestation 1 --Manifestation 2 -Reaction 2 --Manifestation 3 But when you actually click submit, it's not easy to figure out which Reaction a Manifestation is on. Asking other places it seems like there isn't great html support for nested forms. So any solution is either going to serialize the form on the client side to a json before sending, or some inline formset factory solution. I feel like submitting nested forms must be a common case, but none of these have the simplicity I hoped for of django taking the request.POST and giving me the allergy, its reactions, and for each reaction their manifestations. Do any of the solutions in your guide fit particularly well? Would your client send it as a json? Feel like you must have come across this and curious what your choice would be. In any case thanks for the article. |
|