Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:24:01+00:00 2026-05-27T10:24:01+00:00

In a previous question , I was trying to figure out the right strategy

  • 0

In a previous question, I was trying to figure out the right strategy for to passing data between forms in Pyramid. Based on the answer I received, I decided the approach of using a hidden form.

I started implementing this and think there must be a better way of passing along the data. Specifically, passing parameters through the url results in a tuple that is messy to parse.

I want it to be general enough to not to know what parameters the form has and also it needs to handle file fields as well.

How I’m currently attempting to pass the form data to the confirmation page:

@view_config(renderer="templates/derived/load/error.mak", route_name='process_model_route')
def process_model(self):
    #processing logic and validaton, failiure in validation sends user to error.mak
    return HTTPFound(route_url('confirm_model_route', self.request, fparams=self.request.POST))

Route: config.add_route('confirm_model_route', 'rnd2/model/confirm/*fparams')

@view_config(renderer="templates/derived/confirm/model.mak", route_name='confirm_model_route')
def confirm_model(self):
    form_dict = self.request.matchdict['fparams']
     #need to decode and pass to template
     return dict({'load_route':load_route, 'form_dict':form_dict})

The confirm/model.mak template would contain the hidden form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:24:01+00:00Added an answer on May 27, 2026 at 10:24 am

    The idea with this method is:

    1. Client visits page.
    2. Server renders the form.
    3. Client fills in form and POSTs to URL.
    4. Server renders a new page that contains a hidden form with all of the data it just received in the POST.
    5. Client POSTs to a URL, confirming the submission.
    6. Server persists the data from the hidden form and redirects.

    Now depending on usability, it’s up to you to decide how many different URLs you actually want here and how many views in Pyramid. You have to think about what happens with invalid data?

    Notice in the outline above, once the user POSTs the form to a URL, that URL must return the confirmation page containing a hidden form. If you try to redirect the user to a confirmation page instead, you must persist the data somehow, either in a session or through the hack you showed in your example (shoving all of the data into the GET). The second solution is very bad because it abuses the true purpose of GET in HTTP.

    There is also the convention that every POST should result in a redirect to avoid a client submitting the form multiple times. With this in mind you might consider the simple solution of rejecting POSTs that do not have a “confirmed” flag and simply setting the “confirmed” flag in javascript after prompting the user. This allows you to keep your form handling logic simple.

    If you don’t want to rely on javascript and you don’t want to persist the form data in a session, then you run into the issue of not redirecting after the first POST but other than that it should be simple from the outline above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working off my previous question I'm trying to figure out how to achieve what
Following on from a previous question i asked, I'm now trying to figure out
Thanks to suggestions from a previous question , I'm busy trying out IronPython, IronRuby
While trying to implement the second answer to a previous question , I am
I am trying to figure out on which data the crc32 field in the
Based on my previous question , I've trying now to have them in the
I'm trying to make a wrapper for some C-based sparse-matrix-handling code (see previous question
Was just thinking about this question while trying to figure out some code written
This question is in continuation to my previous question . I am trying to
I'm trying to calculate age in flex. I've found this previous question What is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.