Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
177 views
in Technique[技术] by (71.8m points)

python - Dynamic number of Steps using Django Wizard

Is possible that the steps of the wizard are dynamic? For example, the second step occur repeatedly n times?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same issue, and the form wizard (even in Django 1.4) just didn't work for me. It was so much customization that some things started to go wrong and debugging was awful.

I did write some code based on the existing clases. Please see my gists where I posted a solutions that worked great for me. If you have any comments or suggestions (including the name of the class), please post them.

  • Multi-page form manager, arranged as a (math) graph, with dynamic paths (next form depends on actual state and user input) and number of forms. Storage and validation are handled. Based in Django-1.4's django.contrib.formtools.wizard.views.SessionWizardView. https://gist.github.com/3098817

  • Custom Django SessionStorage. Removed all the functionality that dealt with files. Based on Django-1.4's django.contrib.formtools.wizard.storage.base.BaseStorageand django.contrib.formtools.wizard.storage.session.SessionStorage. https://gist.github.com/3080251


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...