[google-appengine] Re: Pretty URLs

2009-08-25 Thread niklasr



On Aug 25, 10:29 pm, pistacchio  wrote:
> Hi,
> maybe I'm missing something from the documentation (I'm just
> starting), but generally, how does url handling work in GAE?
>
> Apart from the basics like
> ---
> application = webapp.WSGIApplication([('/', MainPage), ('/test',
> Test)])
> ---
> that map myapplication and myapplication/test, how do I map something
> like myapplication/forum/show/1234 ?
>
> Thanks in advance
regex [0-9]* matches 1234
webapp.WSGIApplication('/([0-9]*)/([^/]*)',Id),('/([0-9]*)',Id)
then match id from query to instance
a=db.get(db.Key(str(db.Key.from_path('A',int(id)
Sincerely
NickRTZ.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Pretty URLs

2009-08-25 Thread Tim Hoffman

If you use Django and the out of the box app engine experience then
its typically bases on regex matching.

But there are other schemes.  wsgi doesn't really dictate the url
approach you use.

If you use repoze.bfg for instance then you can have arbitrary
traversal of an object graph represented in the urls.

so you typically would only have a single match for the app in
app.yaml and
then urls are function of traversing your content.  (If you have any
experience with Plone then
this notion would be familiar to you)

So based on your example you might have a url along the lines of

myapplication/forums/1234

Where forums is a container entity (persistent or otherwise ) which
can be traversed to a specific forum "1234"
which a default view would be invoked.

See ya

T

On Aug 25, 10:29 pm, pistacchio  wrote:
> Hi,
> maybe I'm missing something from the documentation (I'm just
> starting), but generally, how does url handling work in GAE?
>
> Apart from the basics like
> ---
> application = webapp.WSGIApplication([('/', MainPage), ('/test',
> Test)])
> ---
> that map myapplication and myapplication/test, how do I map something
> like myapplication/forum/show/1234 ?
>
> Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Pretty URLs

2009-08-26 Thread Nuno
If you are using java, there is a plugin to the vRaptor framework that
allows you to configure routes very easy.
There is a empty structure already configured for this at
http://code.google.com/p/rocketscience. You will also find some
documentation and explanation there.




Att

Bruno Bilescky

Wants to learn GWT? Read my blog / Quer aprender a programar? leia meu blog

http://tcninja.blogspot.com




On Wed, Aug 26, 2009 at 3:07 AM, Tim Hoffman  wrote:

>
> If you use Django and the out of the box app engine experience then
> its typically bases on regex matching.
>
> But there are other schemes.  wsgi doesn't really dictate the url
> approach you use.
>
> If you use repoze.bfg for instance then you can have arbitrary
> traversal of an object graph represented in the urls.
>
> so you typically would only have a single match for the app in
> app.yaml and
> then urls are function of traversing your content.  (If you have any
> experience with Plone then
> this notion would be familiar to you)
>
> So based on your example you might have a url along the lines of
>
> myapplication/forums/1234
>
> Where forums is a container entity (persistent or otherwise ) which
> can be traversed to a specific forum "1234"
> which a default view would be invoked.
>
> See ya
>
> T
>
> On Aug 25, 10:29 pm, pistacchio  wrote:
> > Hi,
> > maybe I'm missing something from the documentation (I'm just
> > starting), but generally, how does url handling work in GAE?
> >
> > Apart from the basics like
> > ---
> > application = webapp.WSGIApplication([('/', MainPage), ('/test',
> > Test)])
> > ---
> > that map myapplication and myapplication/test, how do I map something
> > like myapplication/forum/show/1234 ?
> >
> > Thanks in advance
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---