Passing form parameters between views in Pyramid

后端 未结 1 1890
逝去的感伤
逝去的感伤 2021-01-15 15:27

I am creating a form that requires user confirmation before submitting the data. I would like a seperate confirmation page because I need to display quite a bit information

1条回答
  •  隐瞒了意图╮
    2021-01-15 16:24

    This is not a Pyramid-specific answer, but two common approaches to this problem are:

    1. Store the data in a session.
    2. Store the data as a hidden form on the confirmation page, and resubmit with "confirmed"

    I like 2 much better because it's a stateless method. You can also use the exact same form processing logic, and just check for the presence of your "confirmed" POST variable to decide which action to take and view to show (i.e, either the "please confirm" view, or processing and the "processed" view.)

    0 讨论(0)
提交回复
热议问题