Given this excerpt from the py4web documentation:
The request object
From py4web you can import request
from py4web import request
@action('paint')
def paint():
if 'color' in request.query
return 'Painting in %s' % request.query.get('color')
return 'You did not specify a color'
This action can be accessed at:
http://localhost:8000/myapp/paint?color=red
Notice that the request object is the a Bottle request object
My controller signature looks like this:
@action('administration/links', method=['GET', 'POST'])
@action.uses('list.html', session, db, auth.user)
def links():
current_page_number = request.query.get('page') if 'page' in request.query else 1
But, when I try to access:
I get a 404 error. - WARNING:tornado.access:404 GET /py4web_test/link?page=2 (127.0.0.1) 1.79ms
I'm not sure what I'm doing wrong. Is there a way to tell it that you have an optional parameter that may or may not be passed in?
-Jim