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

  • Home
  • SEARCH
  • 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 963941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:44:56+00:00 2026-05-16T01:44:56+00:00

Using Pylons verson 1.0: Working on the FormDemo example from the Pylons book: http://pylonsbook.com/en/1.1/working-with-forms-and-validators.html

  • 0

Using Pylons verson 1.0:
Working on the FormDemo example from the Pylons book:

http://pylonsbook.com/en/1.1/working-with-forms-and-validators.html

My controller has the following functions:

class FormtestController(BaseController):

    def form(self):
        return render('/simpleform.html')

    def submit(self):
        # Code to perform some action based on the form data
        # ...
        h.redirect_to(controller='formtest', action='result')

    def result(self):
        return 'Your data was successfully submitted.'

First I noticed that in the book the author indicates to import redirect_to you executing the following import:

from pylons.controllers.util import redirect_to

This seems to be incorrect, as redirect_to lives in the routes module so I changed it to this:

from routes import redirect_to

everything works fine, no more import error, but when I execute a form submit, i see the following traceback


h.redirect_to(controller='formtest', action='result')
target = url_for(*args, **kargs)
encoding = config.mapper.encoding
return getattr(self.__shared_state, name)
AttributeError: 'thread._local' object has no attribute 'mapper'

can anyone help me?

  • 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-16T01:44:56+00:00Added an answer on May 16, 2026 at 1:44 am

    Try:

    from pylons import url
    from pylons.controllers.util import redirect
    
    # ...
    redirect(url(controller='formtest', action='result'))
    

    You might be better off using the current Pylons 1.0 documentation and the QuickWiki tutorial updated for 1.0, among other references on the site.

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

Sidebar

Related Questions

I'm working on an application using Pylons and I was wondering if there was
I'm using pylons, and my action of controller is: class UserController(BaseController): def create(self): name
I'm working on my first Pylons project using SQLalchemy and sqlite. I'd like to
I am setting up CKAN, a pylons application according to these instructions: http://packages.python.org/ckan/deployment.html But
I am using Pylons to develop an application and I want my controller actions
I am working with Prototype while using the pylons framework and trying to make
I'm using pylons, and some of my urls contains non-English characters, such as: http://localhost:5000/article/111/文章标题
I'm using pylons, and want to use clever css. I created a controller SassController
Is there a way to get the timezone of the connecting user using Pylons,
I was playing around making a simple haiku site using sqlalchemy and pylons. It

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.