Google App engine Url Mapping using WSGIAppl and regx grouping Help Needed
- by spidee
Hi
take this example from google docs
class BrowseHandler(webapp.RequestHandler):
> def get(self, category, product_id):
> # Display product with given ID in the given category.
>
>
> # Map URLs like /browse/(category)/(product_id) to
> BrowseHandler. application =
> webapp.WSGIApplication([(r'/browse/(.*)/(.*)',
> BrowseHandler)
> ],
> debug=True)
>
> def main():
> run_wsgi_app(application)
>
> if __name__ == '__main__':
> main()
How can i change the regx groupings so that Product id is optional
ie the url http://yourdomain.com/category will be sent to the browse handler in the current above example you must add a product id or at least the / after the category
ie
http://yourdomain.com/category/
r'/browse/(.)/(.)'
Any ideas?