It's pretty easy to implement URLs like I talked about. In your controller:
def show_forum():
forum_name = request.get_vars['f']
# ... do something ...
return dict(f=forum_name, ...)
def show_thread():
forum_name = request.get_vars['f']
thread_name = request.get_vars['t']
# ... do something ...
return dict(f=forum_name, t=thread_name, ...)
And in routes.py:
routes_in = (
('/$', '/myapp/default/index'),
('/contact', '/myapp/default/contact'),
('/about', '/myapp/default/about'),
('/media/(?P<v>.+)', '/myapp/static/media/\g<v>'),
# ...put here other fixed URLs...
('/(?P<all>[^/]+)/?', '/myapp/default/show_forum?f=\g<all>'),
('/(?P<forum_name>[^/]+)/(?P<thread_name>[^/]+)/?$',
'/myapp/default/show_thread?f=\g<forum_name>&t=\g<thread_name>'),
)
That's it! ;-)
On 4/10/09, mdipierro <[email protected]> wrote:
>
> Beautiful. I will use this.
>
> Massimo
>
> On Apr 10, 4:25 pm, Speedbird <[email protected]> wrote:
>> Here's the last of my "pets", I present you with pyForum, the FIRST
>> message board written exclusively in web2py, basically a forum system
>> containing many of the goodies of other (php?) message boards out
>> there.
>>
>> http://www.pyforum.org/
>>
>> The "official" release is
>> at:http://www.pyforum.org/pyforum/default/view_forum/2
>>
>> PS - The code is OPEN SOURCE but there are still a couple of things to
>> "iron out" before I put the downloadable source code in the site (see
>> if you can fin them).
>>
>> There is an area so you can add test topics and feel free to creatye
>> your accounts there, to the webpy-thonistas out there I'll be more
>> than happy to give you admin so you can explore the other 50% of the
>> code.
>>
>> Cheers and long live web2py
> >
>
--
Álvaro Justen
Peta5 - Telecomunicações e Software Livre
21 3021-6001 / 9898-0141
http://www.peta5.com.br/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---