Skip to content
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 7 commits into from Nov 13, 2018

Conversation

mmerickel
Copy link
Member

@mmerickel mmerickel commented Nov 12, 2018

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 to add_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.

@mmerickel mmerickel force-pushed the bare-route-prefix-2 branch 2 times, most recently from 22ae59a to b1a9b78 Compare November 12, 2018 05:44
@mmerickel mmerickel changed the title support append_slash=False on add_route support inherit_slash=True on add_route Nov 12, 2018
Copy link
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor docs changes

src/pyramid/config/routes.py Outdated Show resolved Hide resolved
CHANGES.rst Outdated Show resolved Hide resolved
src/pyramid/config/routes.py Outdated Show resolved Hide resolved
@digitalresistor
Copy link
Member

👍

@mmerickel mmerickel merged commit 7429fcb into Pylons:master 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
@mmerickel mmerickel deleted the bare-route-prefix-2 branch November 29, 2020 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants