Skip to content
This repository
100644 237 lines (218 sloc) 12.711 kb
2e651c80 »
2012-02-21 Committing Speedometer's original server code
1 Routes Changelog
2 ========================
4 -- 1.7 (June 8th, 2007)
5 * Fixed url_unquoting to only apply for strings.
6 * Added _encoding option to individual routes to toggle decoding/encoding on a
7 per route basis.
8 * Fixed route matching so that '.' and other special chars are only part of the
9 match should they not be followed by that character. Fixed regexp creation so
10 that route parts with '.' in them aren't matched properly. Fixes #48.
11 * Fixed Unicode decoding/encoding so that the URL decoding and encoding can be
12 set on the mapper with mapper.encoding. Fixes #40.
13 * Don't assume environ['CONTENT_TYPE'] always exists: it may be ommitted
14 according to the WSGI PEP.
15 * Fixed Unicode decode/encoding of path_info dynamic/wildcard parts so that
16 PATH_INFO will stay a raw string as it should. Fixes #51.
17 * Fixed url_for (thus redirect_to) to throw an exception if a Unicode
18 string is returned as that's an invalid URL. Fixes #46.
19 * Fixed Routes middleware to only parse POST's if the content type is
20 application/x-www-form-urlencoded for a HTML form. This properly avoids
21 parsing wsgi.input when it doesn't need to be.
23 -- 1.6.3 (April 10th, 2007)
24 * Fixed matching so that an attempt to match an empty path raises a
25 RouteException. Fixes #44.
26 * Added ability to use characters in URL's such as '-' and '_' in
27 map.resource. Patch by Wyatt Baldwin. Fixes #45.
28 * Updated Mapper.resource handling with name_prefix and path_prefix checking
29 to specify defaults. Also ensures that should either of them be set, they
30 override the prefixes should parent_resource be specified. Patch by Wyatt
31 Baldwin. Fixes #42.
32 * Added utf-8 decoding of incoming path arguments, with fallback to ignoring
33 them in the very rare cases a malformed request URL is sent. Patch from
34 David Smith.
35 * Fixed treatment of '#' character as something that can be left off and
36 used in route paths. Found by Mike Orr.
37 * Added ability to specify parent resource to map.resource command. Patch from
38 Wyatt Baldwin.
39 * Fixed formatted route issue with map.resource when additional collection
40 methods are specified. Added unit tests to verify the collection methods
41 work properly.
42 * Updated URL parsing to properly use HTTP_HOST for hostname + port info before
43 falling back to SERVER_PORT and SERVER_NAME. Fixes #43.
44 * Added member_name and collection_name setting to Route object when made with
45 map.resource.
46 * Updated routes.middleware to make the Routes matched accessible as
47 environ['routes.route'].
48 * Updating mapper object to use thread local for request data (such as
49 environ) and middleware now deletes environ references at the end of the
50 request.
51 * Added explicit option to Routes and Mapper. Routes _explicit setting will
52 prevent the Route defaults from being implicitly set, while setting Mapper
53 to explicit will prevent Route implicit defaults and stop url_for from using
54 Route memory. Fixes #38.
55 * Updated config object so that the route is attached if possible.
56 * Adding standard logging usage with debug messages.
57 * Added additional test for normal '.' match and fixed new special matching to
58 match it properly. Thanks David Smith.
59 * Fixed hanging special char issue with 'special' URL chars at the end of a URL
60 that are missing the variable afterwards.
61 * Changed Routes generation and recognition to handle other 'special' URL chars
62 , . and ; as if they were /. This lets them be optionally left out of the
63 resulting generated URL. Feature requested by David Smith.
64 * Fixed lookahead assertion in regexp builder to properly handle two grouped
65 patterns in a row.
66 * Applied patch to generation and matching to handle Unicode characters
67 properly. Reported with patch by David Smith.
69 -- 1.6.2 (Jan. 5, 2007)
70 * Fixed issue with method checking not properly handling different letter
71 cases in REQUEST_METHOD. Reported by Sean Davis.
72 * redirect_to now supports config.redirect returning a redirect, not just
73 raising one.
75 -- 1.6.1 (Dec. 29, 2006)
76 * Fixed zipsafe flag to be False.
78 -- 1.6 (Dec. 14th, 2006)
79 * Fixed append_slash to take effect in the route generation itself instead of
80 relying on url_for function. Reported by ToddG.
81 * Added additional url_for tests to ensure map.resource generates proper named
82 routes.
83 * WARNING: Changed map.resource initialization to accept individual member and
84 collection names to generate proper singular and plural route names. Those
85 using map.resource will need to update their routes and url_for statements
86 accordingly.
87 * Added additional map.resource recognition tests.
88 * Added WSGI middleware that does route resolving using new ` Routing
89 Vars Spec <>`_.
90 * Added _absolute keyword option route connect to ignore SCRIPT_NAME settings.
91 Suggested by Ian Bicking.
93 -- 1.5.2 (Oct. 16th, 2006)
94 * Fixed qualified keyword to keep host port names when used, unless a host
95 is specifically passed in. Reported by Jon Rosebaugh.
96 * Added qualified keyword option to url_for to have it generate a full
97 URL. Resolves #29.
98 * Fixed examples in url_for doc strings so they'll be accurate.
100 -- 1.5.1 (Oct. 4th, 2006)
101 * Fixed bug with escaping part names in the regular expression, reported by
102 James Taylor.
104 -- 1.5 (Sept. 19th, 2006)
105 * Significant updates to map.resource and unit tests that comb it thoroughly
106 to ensure its creating all the proper routes (it now is). Increased unit
107 testing coverage to 95%.
108 * Added unit tests to ensure controller_scan works properly with nested
109 controller files and appropriately scans the directory structure. This
110 brings the Routes util module up to full code coverage.
111 * Fixed url_for so that when the protocol is changed, port information is
112 removed from the host.
113 * Added more thorough testing to _RequestConfig object and the ability to
114 set your own object. This increases testing coverage of the __init__ module
115 to 100%.
116 * Fixed bug with sub_domain not maintaining port information in url_for and
117 added unit tests. Reported by Jonathan Rosebaugh.
118 * Added unit tests to ensure sub_domain option works with named routes, cleaned
119 up url_for memory argument filtering. Fixed bug with named routes and sub_domain
120 option not working together, reported by Jonathan Rosebaugh.
121 * Changed order in which sub-domain is added to match-dict so it can be used
122 in a conditions function.
124 -- 1.4.1 (Sept. 6th, 2006)
125 * Added sub_domains option to mapper, along with sub_domains_ignore list for
126 subdomains that are considered equivilant to the main domain. When sub_domains
127 is active, url_for will now take a sub_domain option that can alter the host
128 the route will go to.
129 * Added ability for filter functions to provide a _host, _protocol, _anchor arg
130 which is then used to create the URL with the appropriate host/protocol/anchor
131 destination.
132 * Patch applied from Ticket #28. Resolves issue with Mapper's controller_scan
133 function requiring a valid directory argument. Submitted by Zoran Isailovski.
135 -- 1.4 (July 21, 2006)
136 * Fixed bug with map.resource related to member methods, found in Rails version.
137 * Fixed bug with map.resource member methods not requiring a member id.
138 * Fixed bug related to handling keyword argument controller.
139 * Added map.resource command which can automatically generate a batch of routes intended
140 to be used in a REST-ful manner by a web framework.
141 * Added URL generation handling for a 'method' argument. If 'method' is specified, it
142 is not dropped and will be changed to '_method' for use by the framework.
143 * Added conditions option to map.connect. Accepts a dict with optional keyword args
144 'method' or 'function'. Method is a list of HTTP methods that are valid for the route.
145 Function is a function that will be called with environ, matchdict where matchdict is
146 the dict created by the URL match.
147 * Fixed redirect_to function for using absolute URL's. redirect_to now passes all args to
148 url_for, then passes the resulting URL to the redirect function. Reported by climbus.
150 -- 1.3.2 (April 30th, 2006)
151 * Fixed _filter bug with inclusion in match dict during matching, reported by David Creemer.
152 * Fixed improper url quoting by using urllib.encode, patch by Jason Culverhouse.
154 -- 1.3.1 (April 4th, 2006)
155 * Mapper has an optional attribute ``append_slash``. When set to ``True``, any URL's
156 generated will have a slash appended to the end.
157 * Fixed prefix option so that if the PATH_INFO is empty after prefix regexp, its set to
158 '/' so the match proceeds ok.
159 * Fixed prefix bug that caused routes after the initial one to not see the proper url
160 for matching. Caught by Jochen Kupperschmidt.
162 -- 1.3 (Feb. 25th, 2006)
163 * url_for keyword filters:
164 - Named routes can now have a _filter argument that should specify a function that takes
165 a dict as its sole argument. The dict will contain the full set of keywords passed to
166 url_for, which the function can then modify as it pleases. The new dict will then be
167 used as if it was the original set of keyword args given to url_for.
168 * Fixed Python 2.3 incompatibility due to using keyword arg for a sort statement
169 when using the built-in controller scanner.
171 -- 1.2 (Feb. 17th, 2006)
172 * If a named route doesn't exist, and a url_for call is used, instead of using the
173 keyword arguments to generate a URL, they will be used as query args for the raw
174 URL supplied. (Backwards Incompatible)
175 * If Mapper has debug=True, using match will return two additional values, the route
176 that matched, if one did match. And a list of routes that were tried, and information
177 about why they didn't pass.
178 * url_for enhancements:
179 - Can now be used with 'raw' URL's to generate proper url's for static content that
180 will then automatically include SCRIPT_NAME if necessary
181 - Static named routes can now be used to shortcut common path information as desired.
182 * Controller Scanner will now sort controller names so that the longest one is first. This
183 ensures that the deepest nested controller is executed first before more shallow ones to
184 increase predictability.
185 * Controller Scanner now scans directories properly, the version in 1.1 left off the
186 directory prefix when created the list of controllers.
187 (Thanks to Justin for drawing my attention to it)
189 -- 1.1 (Jan. 13th, 2006)
190 * Routes Mapper additions:
191 - Now takes several optional arguments that determine how it will
192 generate the regexp's.
193 - Can now hold a function for use when determining what the available
194 controllers are. Comes with a default directory scanner
195 - Given a directory for the default scanner or a function, the Mapper
196 will now automatically run it to get the controller list when needed
197 * Syntax available for splitting routes to allow more complex route paths, such
198 as ':controller/:(action)-:(id).html'
199 * Easier setup/integration with Routes per request. Setting the environ in a
200 WSGI environ will run match, and setup everything needed for url_for/etc.
202 -- 1.0.2 (Dec. 30th, 2005)
203 * Routes where a default was present but None were filling in improper values.
204 * Passing a 0 would evaluate to None during generation, resulting in missing
205 URL parts
207 -- 1.0.1 (Dec. 18th, 2005)
208 * Request Local Callable - You can now designate your own callable function that
209 should then be used to store the request_config data. This is most useful for
210 environments where its possible multiple requests might be running in a single
211 thread. The callable should return a request specific object for attributes to
212 be attached. See for more information.
214 -- 1.0 (Nov. 21st, 2005)
215 * routes.__init__ will now load the common symbols most people will
216 want to actually use.
217 Thus, you can either:
218 from routes import *
219 Or:
220 from routes import request_confg, Mapper
221 The following names are available for importing from routes:
222 request_config, Mapper, url_for, redirect_to
223 * Route Names - You can now name a route, which will save a copy of the defaults
224 defined for later use by url_for or redirect_to.
225 Thus, a route and url_for looking like this:
226 m.connect('home', controller='blog', action='splash')
227 url_for(controller='blog', action='splash') # => /home
228 Can now be used with a name:
229 m.connect('home_url','home', controller='blog', action='splash')
230 url_for('home_url') # => /home
231 Additional keywords can still be added to url_for and will override defaults in
232 the named route.
233 * Trailing / - Route recognition earlier failed on trailing slashes, not really a bug,
234 not really a feature I guess. Anyways, trailing slashes are o.k. now as in the Rails
235 version.
236 * redirect_to now has two sets of tests to ensure it works properly
Something went wrong with that request. Please try again.