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

Default to default_exceptionresponse_view for add_notfound_view and add_forbidden_view #494

Closed
domenkozar opened this issue Mar 17, 2012 · 7 comments
Milestone

Comments

@domenkozar
Copy link
Member

Currently, to achieve django-like APPEND_SLASH, I do:

from pyramid.httpexceptions import default_exceptionresponse_view

...

config.add_notfound_view(default_exceptionresponse_view, append_slash=True)

It would be nice if those two views had a default value, in case developer want's to change only matching behavior. What do you think? :)

@mcdonc
Copy link
Member

mcdonc commented Mar 17, 2012

Can you describe the API we should expose to let people change the append_slash but use the default exception view?

@domenkozar
Copy link
Member Author

Can we make it default, if view parameter is not specified to add_notfound_view?

@mcdonc
Copy link
Member

mcdonc commented Mar 17, 2012

Probably. There is precedent for this in add_view: you can pass None as a view and it will create one that returns an empty dict on the fly as long as you specify a renderer.

@mcdonc
Copy link
Member

mcdonc commented Sep 16, 2012

@iElectric i'm lazy.. do you want to supply a patch for this?

@domenkozar
Copy link
Member Author

I'll come to it eventually :)

@mmerickel
Copy link
Member

bump?

@domenkozar
Copy link
Member Author

Uh-oh, totally forgot about this one. Putting it on todo stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants