-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support inherit_slash=True on add_route #3420
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmerickel
force-pushed
the
bare-route-prefix-2
branch
2 times, most recently
from
November 12, 2018 05:44
22ae59a
to
b1a9b78
Compare
mmerickel
force-pushed
the
bare-route-prefix-2
branch
from
November 12, 2018 05:45
b1a9b78
to
dff0798
Compare
mmerickel
changed the title
support append_slash=False on add_route
support inherit_slash=True on add_route
Nov 12, 2018
stevepiercy
requested changes
Nov 12, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor docs changes
👍 |
stevepiercy
approved these changes
Nov 13, 2018
Deimos
added a commit
to spectria/tildes
that referenced
this pull request
Nov 20, 2018
Pyramid 1.10 adds config.route_prefix_context(), which can be used like this to organize routes under a prefix a little more easily. In the next release it should also be possible to move the route for the prefix itself inside the context manager with an empty pattern and an inherit_slash=True argument. See Pylons/pyramid#3420
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #3415 which is more explicit and backward compatible. To opt-out of the default and to get a bare url without a trailing slash, specify
inherit_slash=True
toadd_route
. This triggers an empty pattern to inherit the trailing slash from the route prefix. This means it will have a trailing slash or not depending on the route prefix, giving control to the integrator to decide if the route has a slash or not.