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

deprecate view arguments in add_route #164

Closed
mmerickel opened this issue Apr 5, 2011 · 2 comments

Comments

Projects
None yet
3 participants
@mmerickel
Copy link
Member

commented Apr 5, 2011

Pretty please? The idea was nice but I think has 2 problems:

  • It hurts newcomers who need to learn that routes are not views, hiding the fact that you may have multiple views per route, where if the option wasn't there they would be forced to use add_view or @view_config.
  • People who understand the separation are very unlikely to use it, as they're probably creating multiple views per route using either @view_config or add_view.

Pyramid could deprecate the usage of those arguments, possibly by removing them from the documentation (or putting a nice big warning in the docs) and issuing a warning when they are used.

@bbangert

This comment has been minimized.

Copy link
Member

commented Apr 5, 2011

I'll admit that I'm actually somewhat in favor of this, as I've seen people add a dozen add_route statements with the same route_name and url segment, and they're using it to actually add additional views with different predicates for the same route.

While at first I thought maybe just the documentation should show add_route followed by an add_view, it then seems odd to explain, "and now to confuse you, lets mix one of the views for this route into the add_route statement, but keep all the additional views for this route in separate statements....".

Such docs has me agreeing more with you on documenting them separately to help emphasize that adding a view for a route_name with some predicates (or not) is separate from setting up the routes. The current method of using add_route to add the route and view clearly has people believing there's a closer binding between the route+view than actually exists thus the repeat add_route calls with the same name+path but different view args.

mmerickel added a commit to mmerickel/pyramid that referenced this issue Apr 20, 2011

@mcdonc

This comment has been minimized.

Copy link
Member

commented Apr 22, 2011

raydeo's fork was merged into master via 1612fe7

@mcdonc mcdonc closed this Apr 22, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.