Routes

Latest version: v2.5.1

Safety actively analyzes 629503 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 8

1.3.1

===============================
* Mapper has an optional attribute ``append_slash``. When set to ``True``, any URL's
generated will have a slash appended to the end.
* Fixed prefix option so that if the PATH_INFO is empty after prefix regexp, its set to
'/' so the match proceeds ok.
* Fixed prefix bug that caused routes after the initial one to not see the proper url
for matching. Caught by Jochen Kupperschmidt.

1.3

=============================
* url_for keyword filters:
Named routes can now have a _filter argument that should specify a function that takes
a dict as its sole argument. The dict will contain the full set of keywords passed to
url_for, which the function can then modify as it pleases. The new dict will then be
used as if it was the original set of keyword args given to url_for.
* Fixed Python 2.3 incompatibility due to using keyword arg for a sort statement
when using the built-in controller scanner.

1.2

=============================
* If a named route doesn't exist, and a url_for call is used, instead of using the
keyword arguments to generate a URL, they will be used as query args for the raw
URL supplied. (Backwards Incompatible)
* If Mapper has debug=True, using match will return two additional values, the route
that matched, if one did match. And a list of routes that were tried, and information
about why they didn't pass.
* url_for enhancements:
Can now be used with 'raw' URL's to generate proper url's for static content that
will then automatically include SCRIPT_NAME if necessary
Static named routes can now be used to shortcut common path information as desired.
* Controller Scanner will now sort controller names so that the longest one is first. This
ensures that the deepest nested controller is executed first before more shallow ones to
increase predictability.
* Controller Scanner now scans directories properly, the version in 1.1 left off the
directory prefix when created the list of controllers.
(Thanks to Justin for drawing my attention to it)

1.1

=============================
* Routes Mapper additions:
Now takes several optional arguments that determine how it will
generate the regexp's.
Can now hold a function for use when determining what the available
controllers are. Comes with a default directory scanner
Given a directory for the default scanner or a function, the Mapper
will now automatically run it to get the controller list when needed
* Syntax available for splitting routes to allow more complex route paths, such
as ':controller/:(action)-:(id).html'
* Easier setup/integration with Routes per request. Setting the environ in a
WSGI environ will run match, and setup everything needed for url_for/etc.

1.0.2

===============================
* Routes where a default was present but None were filling in improper values.
* Passing a 0 would evaluate to None during generation, resulting in missing
URL parts

1.0.1

===============================
* Request Local Callable - You can now designate your own callable function that
should then be used to store the request_config data. This is most useful for
environments where its possible multiple requests might be running in a single
thread. The callable should return a request specific object for attributes to
be attached. See routes.__init__.py for more information.

Page 7 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.