On Jan 15, 9:14 am, djidjadji <[email protected]> wrote:
> You could use the URL dispatcher to check for validity of the passed
> id by making the id part of the URL
>
> http://me-for-president.appspot.com/item/1
>
> in the code
>
> class ItemPage(webapp.RequestHandler):
> def get(self, id):
> id = int(id)
> # rest of the handler
>
> application = webapp.WSGIApplication([('/item/(\d+)', ItemPage)],
> debug=True)
>
Thanks for this information! Exactly what I was trying to understand.
I changed the handler like this:
class Article(webapp.RequestHandler):
def get(self, id):
id = int(id)
....
self.response.out.write("""<a href="/item/%s">article title</
a> """ %
(id))
and it works fine. But now how do I get the article title from the
other handler where it is inside the for loop. Because in this handler
I cannot use "item.title". What is the way to do this?
Thanks again.
--
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.