Let's say i go to myblog.com/post/12
. The /post
handler is already defined, but how can i get the parameter being passed? 12
in this case is the post_id
.
I'm using the Python SDK.
views:
23answers:
1
+3
A:
Sure.
Example rule:
('/post/(\d+)', views.PostHandler)
Example view:
class PostHandler(BaseHandler):
''' Handler for viewing blog posts. '''
def get(self, id):
blog_post = models.BlogPost.get_by_id(int(id))
Adam Bernier
2010-04-23 16:18:00
Works like a charm. Thank you. :)
Jorge
2010-04-23 16:22:23
Cheers mate. Glad you got it working :-)
Adam Bernier
2010-04-23 16:30:51