[英]what is the best way to approach where next is depending on last step in django?
My concern is i am implementing one application, where i have multiple steps and in each step i have multiple forms. 我关心的是我正在实现一个应用程序,其中我有多个步骤,并且在每个步骤中我都有多种形式。 in step one my form two is depending on form one.
在第一步中,我的第二种形式取决于第一种形式。
Scenario 1: 方案1:
And inside form one also few questions are there. 在表格一中,还有几个问题。 depending on the answer of questions field should get changed in form.
根据问题的答案,字段的形式应更改。
for example
form 1
Q 1) Are you working?
ans) a) yes b) No
if answer is yes it should display different fields and if no it should display diffident fields. 如果答案为是,则应显示不同的字段,如果否,则应显示不同的字段。
Scenario 2: 方案2:
There is a address field in form 1 which i want to use in form 2. It should provide the option to select that address or enter new address. 我想在表格2中使用表格1中的地址字段。它应该提供选择该地址或输入新地址的选项。
Please provide me the best approach or available modules which i can use. 请提供我可以使用的最佳方法或可用模块。 If any specific name for this terminology please let me know.
如果该术语有任何特定名称,请告诉我。
Django comes with a Form Wizard that should be used for this kind of task. Django随附了一个表单向导 ,应将其用于此类任务。 From the docs, the Form Wizard:
在文档中,表单向导:
...splits forms across multiple Web pages.
...将表格拆分为多个网页。 It maintains state in one of the backends so that the full server-side processing can be delayed until the submission of the final form.
它在后端之一中保持状态,以便可以延迟整个服务器端处理,直到提交最终表单为止。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.