views:

34

answers:

1

I read the document

http://code.google.com/appengine/docs/python/tools/webapp/requesthandlerclass.html

but I cant find any information of the args parameters

+5  A: 

Depends on the regular expressions in your URL matching. For example:

def main():
    application = webapp.WSGIApplication([
         ('/rechnungsdatencontainer/([a-z0-9_-]+)', RechnungsdatencontainerHandler),
         ('/empfaenger/([A-Za-z0-9_-]+)/rechnungen/([A-Za-z0-9_-]+)\.?(json|pdf|xml|invoic|html)?', RechnungslisteHandler),
         ('/admin/credentials', CredentialsHandler),
         ('/', Homepage)],
        debug=True)
    util.run_wsgi_app(application)

RechnungsdatencontainerHandler.get() sees one parameter, RechnungslisteHandler().get() sees three and CredentialsHandler and Homepage get no parameters.

class RechnungsdatencontainerHandler(webapp.RequestHandler):
    def get(containerid):
        ....

class RechnungslisteHandler(webapp.RequestHandler):
    def get(empfaenger, rechung, fmt):
        ....

Basically every pair of (braces) in the RegExp results in a get parameter.

I assume you could also use named parameters, something like (?P<kundennr>[A-Za-z0-9_-]+) to get kwargs in your get function, but I haven't tried that.

mdorseif
Just for reference, this is in the docs: http://code.google.com/appengine/docs/python/tools/webapp/running.html.
Robert Kluin