Tuesday, March 3, 2020

Re: How to create multipage forms with different models

@suraj Could you show by example? I have tried one way which I posted the dpaste link with my first post but it doesn't work. I.e when I clicked submit I don't get any new post in the template. Thanks 

On Tue 3. Mar 2020 at 11.44, Suraj Thapa FC <surajthapafc@gmail.com> wrote:
There can be only one view for one page....
You have to implement both in same view 

On Tue, 3 Mar 2020, 2:58 pm victor awakan, <victorawakan@gmail.com> wrote:
What I meant was I want one form to be saved in one model and the second form to be saved in another model. I did that using form-tools but I want to learn how to do it using function based views. Thanks.

On Tuesday, March 3, 2020 at 11:19:40 AM UTC+2, Naveen Arora wrote:
Hi,

What problem you are facing ? A form can be sent to any template using its object and context dictionary. "Split the form to separate templates" ? This seems unusual, create different forms if you want to use more templates. 

Cheers :)
Naveen Arora

On Monday, 2 March 2020 18:08:44 UTC+5:30, victor awakan wrote:
I am a building a small project in Django. I am able to create two or more forms in a template but now, I want to split the form to separate templates with each form belong to different models. How can I achieve this? Here is a link to dpaste with the multiple forms in a template I created: http://dpaste.com/1WX0RC8

All help and suggestions will be appreciated.
PS. I have tried it with formtools and it worked. I am trying to learn how to do the same thing with function based views. Thanks

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0c158202-002d-484d-b0c1-332ca7e3c606%40googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPjsHcESh5A04xcL4d4bNCrxWR07NpdN7o6Ef20FUA-UvNziiA%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAipwd8dYWwzCiPrj4mywq82emncMsPARHHWf16egJnahJpi9w%40mail.gmail.com.

No comments:

Post a Comment