简体   繁体   English

下一步取决于Django的最后一步的最佳方法是什么?

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

相关问题 在django Web应用程序中实现“上次看到”功能的最佳方法是什么? - What is the best way to implement a 'last seen' function in a django web app? 用Django实现配置应用的最佳方法是什么? - What is the best approach to implement configuration app with Django? 根据 django rest 框架中的某些条件,允许更改权限的最佳方法是什么? - What is the best way to allow change permissions depending of some conditions in django rest framework? 根据另一个类在django中动态加载特定应用的最佳方法是什么? - What is the best way to dynamically load a specific app in django depending of another class? 获取下一张和上一张图片的最佳方式Django - Best way to get next and previous images Django 设计模型字段(如Django中的列表)的最佳方法是什么? - What is the best approach to design model fields that is like a list in Django? 在现有 Django 应用程序中更改主键的最佳方法是什么? - What is the best approach to change primary keys in an existing Django app? 在Django项目中使用Web套接字的最佳方法是什么? - What is the best approach to use Web Sockets with Django projects? 你下一步怎么做? - what is the next step? 编写根据参数执行不同计算的函数的最佳方法是什么? - What is the best way to write a function that performs different calculations depending on a parameter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM