What's passed to the article_id parameter? How does GAE know what to pass?
On Jan 3, 7:58 pm, "Rodrigo Moraes" <[email protected]> wrote: > On Sat, Jan 3, 2009 at 10:02 PM, MajorProgamming wrote: > > Firstly, Do these mappings also support regular expression mappings? > > They *are* regular expressions. That's how those expressions are evaluated. > > > Secondly, How can I use "dynamic mappings" (like instead of > >http://example.com/article?id=20--http://example.com/article/20)? > > ('/article/([\d]+)', Article) > > With the above rule, the matched values are passed to the handler, in > order. So in Article you'll have the method get(self, article_id), > which receives the article id from the matched rule. > > > [and is there any advantage to doing query strings in this fashion?] > > Well, sometimes query strings are more convenient, but in many times > you would want to certify that only url's with minimally valid > parameters (in the above example, an integer) will match. With ?id=20, > you'll have to check if an id is passed in the handler method, *after* > the dispatch process. It's also a matter of aesthetics and, most > important, how your handlers are organized. > > -- rodrigo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
