4 messages in com.googlegroups.pylons-discussRe: Routes - show formatted resource
FromSent OnAttachments
Sok Ann Yap24 Jun 2008 21:43.patch
Ben Bangert28 Jun 2008 11:37 
Ben Bangert28 Jun 2008 12:44 
__wyatt28 Jun 2008 18:43 
Subject:Re: Routes - show formatted resource
From:Ben Bangert (be@groovie.org)
Date:06/28/2008 11:37:00 AM
List:com.googlegroups.pylons-discuss

On Jun 24, 2008, at 9:43 PM, Sok Ann Yap wrote:

I am using resource mapper in Routes (1.9) to get rest style URL, e.g. map.resource('message', 'messages'). The problem is that I can't show a resource in a particular format, e.g. /messages/12.json , because "12.json" will be assigned to the id variable while the format variable remains empty.

Are you using the formatted named url_for? ie, url_for('formatted_message', id=12, format='json')?

This can be fixed by reversing the order of the last 2 connect lines in routes/mapper.py. Once reversed, "12" will be assigned to id and "json" will be assigned to format.

Thanks, I'll take a look at applying this today.

Cheers, Ben