[英]How to save data to the same model from forms in different pages…Registration multiple fields? Django
i'm trying to make a user registration with multiple fields to save in the same model. 我正在尝试使用多个字段进行用户注册以保存在同一模型中。 The idea is have a form in the home page with username and password and when press button continue the user is redirected to another page with multiple fields to insert personal info for the user profile. 这个想法是在主页上有一个带有用户名和密码的表格,当按下按钮继续时,用户将被重定向到另一个具有多个字段的页面,以便为用户配置文件插入个人信息。 I imagine i must have two different views for that, but i don't understand how put all this data together. 我想我必须对此有两种不同的看法,但是我不明白如何将所有这些数据放在一起。
Thanks! 谢谢!
You could use the FormWizard ( https://django-formtools.readthedocs.io/en/latest/wizard.html ) 您可以使用FormWizard( https://django-formtools.readthedocs.io/en/latest/wizard.html )
Basically you would have one form for user/password and another form for the other fields. 基本上,您将为用户/密码使用一种形式,对其他字段使用另一种形式。 Take a look 看一看
在您的情况下,我希望使用JavaScript处理HTML内容,并且在一切准备就绪后,只需发送一个ajax调用即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.