If you are already add/deleting in place using ajax you can use that to your advantage. Don't think of it as a single form - each ajax capable component (profile, extra1, extra2, extra3) is a separate form. You have a view that populates your template with multiple forms - the profile and each extra. Then each of those has an ajax endpoint for update/delete. You can also have and add extra button that has an endpoint that provided the form via ajax, and its save endpoint is the save/update endpoint you already have.
On Saturday, April 9, 2016 at 12:02:02 PM UTC-5, Scot Hacker wrote: > > > > On Friday, April 8, 2016 at 11:27:01 AM UTC-7, Tundebabzy wrote: >> >> I don't know if I'm off target but..... >> >> I'm presently work on something like this where I have have to save three >> models at a go. One model is a stand alone while the other two have a >> foreign key to the stand alone model which is a many to one relationship. >> So to implement the many to one where I can save many of the dependent >> models together with the standalone models, I made use of inline formset >> and no problems thus far. >> > > It's interesting - Django provides non-model forms, model forms, and > formsets for dealing with multiple instances of the same model, but no way > to build a single form that deals with multiple model types simultaneously. > At this point, it's looking pretty much like I'll solve this outside of the > Django box, by generating JSON representing the collection of data and > using Angular to add/edit to the set with client-side validation, then > post-processing the results in a Django view. > > ./s > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/485dd261-69f2-458f-8015-bf6730ea2704%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.