开发者

Django: One FormWizard for multiple models

开发者 https://www.devze.com 2022-12-19 21:37 出处:网络
Would it be possible/best practice to use 1 For开发者_开发知识库mWizard for manipulating multiple models?

Would it be possible/best practice to use 1 For开发者_开发知识库mWizard for manipulating multiple models?

I've experimented with the FormWizard and have defined all the forms. The page 'flow' itself works like a charm. However with all the checks that need to be done and Models that are manipulated it feels like I'm sticking code in the form's __init__ and/or process_step() that really belongs in views.py. The docs even state: "Dont manipulate form data via process_step().

Testing a concept with everything in one view, thus using a last_submitted_page (the step equiv) it feels like I'm writing another formwizard.

Anybody been here before? Tips welcome.

Thanx a lot.

Regards,

Gerard.


Zooming out on the issue I decided to go for the FormWizard approach. I re-confirmed that code is easily placed in forms.py and that you can get your model info by using. the process_step().

GrtzG

0

精彩评论

暂无评论...
验证码 换一张
取 消