Hi all,
I'm having some trouble with my routes setup. My URL schema is as
follows:
"/forum/<forum_name>/<thread_name>/[optional_post_id]"
and this is how I setup my route:
map.connect('show-thread', '/forum/:forum/:thread/:post/',
controller='forum', action='showThread', post=None)
And, it all works just fine for viewing forums. Now I want to add an
option
for replying to forums, so this is the schema I thought of using:
"/forum/forum_name/thread_name?new=True" - reply to thread
"/forum/forum_name/thread_name/post_id?new=True" - reply to a post
in the thread
The problem is, how do I make the URL with `url_for` for this kind of
scheme? If I write
something like this:
h.url_for('show-thread', forum='forum_name', thread='thread_name',
new=True)
my controller doesn't get that `new` as a keyword argument. And if I
change my
route definition, and add another keyword argument, "new", like this:
map.connect('show-thread', '/forum/:forum/:thread/:post/',
controller='forum', action='showThread', post=None, new=False)
then `url_for` function creates an URL something like this:
http://localhost:8001/forum/showThread?forum=faq&thread=thread1&new=True&post=0
And that's not what I had in mind :(. Any ideas how to solve this
problem?
Any help greatly appreciated.
Karlo.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---