如何将新的 FormWizard 包装在视图中?
使用新的 formwizard 工具(https://github.com/stephrdev/django-formwizard),如何将 Django 表单向导包装在视图中?而不是在 urls.py 中创建它。我需要这样做,以便我可以访问请求和其他内容。
有人有这方面的示例代码吗?
预先感谢,
问候。
Using the new formwizard tool (https://github.com/stephrdev/django-formwizard), How do I wrap the Django Form Wizard in a view? Instead of create it in the urls.py. I need to do this so I can access request and other stuff.
Does anyone have some example code for this?
Thanks in advance,
Greetings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当前版本的 django-formwizard 基于 Django 的基于类的视图。
您可以通过重写向导子类中所需的方法并使用 self.request 来访问请求对象。
The current version of django-formwizard is based on Django's class based views.
You can access the request object by overriding the method you want in your wizard subclass and use
self.request
.