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 3964230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:18:32+00:00 2026-05-20T03:18:32+00:00

I get a problem in a form handler in app engine (Python). Basically when

  • 0

I get a problem in a form handler in app engine (Python). Basically when I post the form to the handler I get the following traceback:

INFO 2011-02-07 14:06:59,364 dev_appserver.py:3317] “GET /favicon.ico HTTP/1.1” 404 –
Traceback (most recent call last):

File “/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wsgiref/handlers.py”, line 92, in run
self.result = application(self.environ, self.start_response)

File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py”, line 531, in __call__
handler.handle_exception(e, self.__debug)

File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py”, line 394, in handle_exception
self.error(500)
TypeError: ‘bool’ object is not callable

INFO 2011-02-07 14:07:01,986 dev_appserver.py:3317] “POST /newevent HTTP/1.1” 500 -`

On the browser I get the message ‘A server error occurred. Please contact the administrator’. As you can see, the error happens before the POST command, and doesn’t seem to stem from any of my handler code. Here’s the handler class for that form (post_secure is a method called by the post method in the parent class):

class SaveEvent(BaseHandler):
def post_secure(self):
    userinfo = db.GqlQuery("SELECT * FROM User WHERE fbid = :1", self.user['uid'])[0]
    newevent = Event(parent=userinfo)
    self.error = False
    self.template_values = {}

    if (self.request.get('eventname') == ""):
        self.template_values['eventnameerror'] = True
        self.error = True
    else:
        newevent.eventname = self.request.get('eventname')

    if (self.request.get('venuename') == ""):
        self.template_values['venuenameerror'] = True
        self.error = True
    else:
        newevent.venuename = self.request.get('venuename')

    if (re.match("[0-9]+\.[0-9][0-9]", self.request.get('eventprice')) == None):
        self.template_values['eventpriceerror'] = True
        self.error = True
    else:
        newevent.price_pence = int(float(self.request.get('eventprice')) * 100)

    if (re.match("[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]", self.request.get('eventdate')) == None):
        self.template_values['eventdateerror'] = True
        self.error = True
    else:
        day = re.split("/", self.request.get('eventdate'))[0]
        month = re.split("/", self.request.get('eventdate'))[1]
        year = re.split("/", self.request.get('eventdate'))[2]

    if (re.match("[0-2][0-9]:[0-5][0-9]", self.request.get('eventtime')) == None):
        self.template_values['eventtimeerror'] = True
        self.error = True
    else:
        hours = re.split(":", self.request.get('eventtime'))[0]
        minutes = re.split(":", self.request.get('eventtime'))[1]

    try:
        newevent.date = datetime.datetime(year, month, day, hours, minutes, 0, 0)
    except ValueError:
        self.template_values['eventdatetimeerror'] = True
        self.error = True

    if (newevent.date < datetime.datetime.now()):
        self.template_values['eventdateerror2'] = True
        self.error = True

    if (self.request.get('eventlink') == ""):
        self.template_values['eventlinkerror'] = True
        self.error = True

    if (self.error == True):
        self.template_values['eventname'] = self.request.get('eventname')
        self.template_values['venuename'] = self.request.get('venuename')
        self.template_values['eventprice'] = self.request.get('eventprice')
        self.template_values['eventdate'] = self.request.get('eventdate')
        self.template_values['eventtime'] = self.request.get('eventtime')
        self.template_values['eventlink'] = self.request.get('eventlink')
        self.tpl('addevent.html', self.template_values)

    newevent.put()

    self.template_values = {
        'newevent' : newevent
    }

    self.tpl('eventadded.html', self.template_values)
  • 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-20T03:18:33+00:00Added an answer on May 20, 2026 at 3:18 am

    The RequestHandler class has a method named error

    error(code)

    A shortcut method for handlers to use to return an error response. Clears the response output stream and sets the HTTP error code to code. Equivalent to calling self.response.clear() and self.response.set_status(code).

    Your POST handler above overwrites that method with a boolean value, and then when the framework attempts to call self.error(500) it throws an exception because the value of self.error is no longer a callable.

    Use a different member variable name than error to prevent this.

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

Sidebar

Related Questions

No related questions found

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.