简体   繁体   English

如何从不同页面的表单中将数据保存到同一模型中……注册多个字段? Django的

[英]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.

相关问题 如何在同一个模型的同一个 Django 视图中保存多个表单? 当前最后一个表单在保存时覆盖 - How do I save multiple forms in the same Django View from the same Model? Currently the last form overwrites in save 如何在Django中保存具有相同模型但具有不同数据的数据 - How to save the data that has same model but with different data in Django Django以相同的形式保存多个数据-不同用户的不同数据 - Django save multiple data with same form - different data for different users 将额外的字段保存到 django model 除了 django 表单中存在的字段(对于同一型号) - Save extra fields to django model apart from the fields which were present in django form(for the same model) 如何根据Django中表单中的字段过滤模型表单中的数据 - how to filter data in model forms according to fields in form in Django Django在不同的模型字段上保存图像 - Django Save Image on different model fields Django Haystack在同一模型的多个字段上的索引 - Django Haystack index on multiple fields from same model Django Model, Forms 字段 - Django Model, Forms Fields 如何从 save_formset 访问 Django Model 字段 - How to access Django Model Fields from save_formset Django 中的同一 model 中具有更多字段的不同用户 - Different user with more fields in the same model in Django
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM