I recommend taking a look at Formsets and, in particular, Inline Formsets.
The documentation:
ModelForms: https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/
ModelFormsets: 
https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/#model-formsets
InlineFormsets: 
https://docs.djangoproject.com/en/1.10/topics/forms/modelforms/#inline-formsets

The API documentation:
https://docs.djangoproject.com/en/1.10/ref/forms/models/
https://docs.djangoproject.com/en/1.10/ref/forms/models/#inlineformset-factory

You may want to use something like Django dynamic forms on the frontend to 
utilize JavaScript.
https://github.com/elo80ka/django-dynamic-formset



From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Axil-Mar Imam
Sent: Tuesday, February 21, 2017 7:00 PM
To: Django users
Subject: Re: Looking for Django tutorial that illustrates master/detail data 
models

Hi. I wondering if you have found a way about your problem? Im actually 
researching on this problem as well, unfortunately, haven't found a solution to 
this. If you have, I would really appreciate if you share it. Thanks.

On Wednesday, December 31, 2008 at 10:44:57 AM UTC+8, ldm999 wrote:
Thanks for your response.

I should have been more clear. I'm looking for examples of views/forms
to manage the children of a parent child model. Eg how to add/change/
delete a book on a book list.

I don't recall the Django tutorial covering this and I just looked
again. It appears to focus more on the Django Admin than on custom
forms. And what it does cover wrt forms seems mostly focused on a form
for a stand-alone model rather than the child of a prent model where
you need the context of the parent to make sure you add a new item to
the right parent, and edit/delete the correct item based on its
parent.

I'll take another detailed look at the official tutorial to see if
this is covered.

On Dec 30, 6:02 pm, Daniel Roseman 
<roseman.dan...@googlemail.com<mailto:roseman.dan...@googlemail.com>>
wrote:
> On Dec 30, 8:22 pm, ldm999 
> <malcolm.le...@gmail.com<mailto:malcolm.le...@gmail.com>> wrote:
>
> > Eg:
> > Lists (books, movies, restaurants) and multiple items per list.
>
> > Web forms would allow user to:
> > - Add/change/delete lists
> > - Add/change/delete list items
>
> > TIA
>
> Have you actually read the tutorial on the Django site? The Poll
> application covers exactly this.
> --
> DR.
--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto: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/9e3e6e5a-729c-46ab-aa12-b73207a0d88b%40googlegroups.com<https://groups.google.com/d/msgid/django-users/9e3e6e5a-729c-46ab-aa12-b73207a0d88b%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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/6e751ae3b2984b77bc7f1ec44c44ea87%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to