On Mon, Apr 27, 2009 at 3:03 AM, Adrian von Bidder <[email protected]> wrote:
> Heyho!
>
> Is there documentation available (assuming there is some support code) on
> how to handle URLs?
>
take a look at tg.url and tg.redirect

>  * get the base URL of the controller?  There is request.application_url,
> can I get the path from tg where the controller is hooked up to get the next
> level(s) up to the controller where I'm in?  (Obviously I can specify pass
> this in from config file or pass a variable when I hook up the controller,
> but since obviously tg already knows this url, I don't want to duplicate
> this...)
>
>  * should I cobble together URLs manually in templates?  To create a "edit
> this record" link, I currently do something like:
>        <a href="EDIT?id=${mydata.id}">edit</a>
> Is this the right thing to do?
>
>  * related: once I properly use repoze, I'll need to pass in the
> authenticated session in the above case.  Is there a call to create the URL,
> adding session id if available?  (Or does repoze/tg always use cookies?)
>
>  * not really related: special chars in URLs?
> I'd like to have short URLs, so http://.../name would directly show the data
> record "name" (without having a /.../view/name URL).  Works nicely with a
> default method of my controller, Since I don't want to restrict acceptable
> names, I need to reserve a namespace for administrative requests (login
> page, "create new" URL etc.)  .../?cmd=blah would be one solution, but then
> I'd have to always go through the default method of the controller, so I
> couldn't use @validate and other niceties.  (... mnight as well write it as
> CGI in shell ;-)  So I thought about using URLs with a "non-special special
> char", i.e. non-alphanumerical that is passed throug normally by browsers
> and web servers.  '!' is my favorite right now, but I think '$' might do the
> same, or possibly '|'.  ('_' might work, too, but I'd like to keep this
> available as a normal character to get URLs without real space characters.)
>
> So, in short: how do I map this in tg to the method of a controller?
>
> cheers
> -- vbi
>
> --
> featured link: Debian Bookmark Collection - http://bookmarks.debian.net/
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to