pombreda / formalchemy

Automatically exported from code.google.com/p/formalchemy
MIT License
0 stars 0 forks source link

In formalchemy/ext/pylons/, with pylons version > 0.7 I suggest to use named route to define "static_contents" route #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

In formalchemy/ext/pylons/, with pylons version > 0.7 I suggest to use
named route to define "static_contents" route :

map.connect('static_contents', '%s/static_contents/{id}' % url,
controller=controller, action='static')

instead of :

map.connect('%s/static_contents/{id}' % url, controller=controller,
action='static')

then we can use 

url_for('static_contents', id='admin.css')}}

which is cleaner than :

url_for(modelname='static_contents', action='admin.css', id=None)

Now, I can't change template for backward compatibility.

Original issue reported on code.google.com by klein.stephane on 16 Feb 2009 at 12:13

Attachments:

GoogleCodeExporter commented 9 years ago
is this work with old pylons versions ? at least 0.9.6

Original comment by gael.pas...@gmail.com on 20 Feb 2009 at 12:04

GoogleCodeExporter commented 9 years ago
0.9.6 does support named routes, although you'd need to use the old :id instead 
of {id}

Original comment by jbel...@gmail.com on 28 Feb 2009 at 1:44

GoogleCodeExporter commented 9 years ago
so feel free to apply your patch but also change this for the old routes style

Original comment by gael.pas...@gmail.com on 12 Mar 2009 at 10:45