Re: Django - Populating more than one model from the same form ?

52 views
Skip to first unread message
Message has been deleted

ludovic coues

unread,
Jul 9, 2016, 3:48:09 PM7/9/16
to django...@googlegroups.com
Have you done the django tutorial ?

Part 7 [1] Should answer your question.

[1] https://docs.djangoproject.com/en/1.9/intro/tutorial07/

2016-07-09 18:03 GMT+02:00 <sevenr...@gmail.com>:
> I have a 2 Models, Product and Image. Image has a foreign key to Product.
>
> In the form I want to appear information from both the Product and the
> Image, because are related.
>
> I use also GCBV for views, and model for forms.
>
> How can be done ?
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@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/b4e9613b-e7b0-4a21-adb2-d3a3d468aa1f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

ludovic coues

unread,
Jul 9, 2016, 3:52:38 PM7/9/16
to django...@googlegroups.com
If you are trying to do it outside of the admin, the previous link
might not be exactly what you are look for. The doc on inlines formset
[1] might be more usefull. It's the same thing, but as a generic form
instead of a part of the admin.


[1] https://docs.djangoproject.com/en/1.9/topics/forms/modelforms/#inline-formsets
Reply all
Reply to author
Forward
Message has been deleted
0 new messages