Change gendered language in examples
Some examples in documentation use "dude" and "bro" -- for example, "Not
found, bro". While playful, this language can make some people
uncomfortable. I have changed the wording to something equally playful
that doesn't make assumptions about the reader's gender.
| | |
| | | |
| | | - Cris Ewing, 2016/06/03 |
| | | |
| | | - Jean-Christophe Bohin, 2016/06/13 |
| | | - Jean-Christophe Bohin, 2016/06/13 |
| | | |
| | | - Jon Davidson, 2016/07/18 |
| | |
| | | :linenos: |
| | | |
| | | def notfound(request): |
| | | return Response('Not Found, dude', status='404 Not Found') |
| | | return Response('Not Found', status='404 Not Found') |
| | | |
| | | def main(globals, **settings): |
| | | config = Configurator() |
| | |
| | | |
| | | @notfound_view_config() |
| | | def notfound(request): |
| | | return Response('Not Found, dude', status='404 Not Found') |
| | | return Response('Not Found', status='404 Not Found') |
| | | |
| | | def main(globals, **settings): |
| | | config = Configurator() |
| | |
| | | |
| | | @notfound_view_config(request_method='GET') |
| | | def notfound_get(request): |
| | | return Response('Not Found during GET, dude', status='404 Not Found') |
| | | return Response('Not Found during GET', status='404 Not Found') |
| | | |
| | | @notfound_view_config(request_method='POST') |
| | | def notfound_post(request): |
| | | return Response('Not Found during POST, dude', status='404 Not Found') |
| | | return Response('Not Found during POST', status='404 Not Found') |
| | | |
| | | def main(globals, **settings): |
| | | config = Configurator() |
| | |
| | | from pyramid.httpexceptions import HTTPNotFound |
| | | |
| | | def notfound(request): |
| | | return HTTPNotFound('Not found, bro.') |
| | | return HTTPNotFound() |
| | | |
| | | def no_slash(request): |
| | | return Response('No slash') |
| | |
| | | However, if a request enters the application with the ``PATH_INFO`` value of |
| | | ``/no_slash/``, *no* route will match, and the slash-appending not found view |
| | | will not find a matching route with an appended slash. As a result, the |
| | | ``notfound`` view will be called and it will return a "Not found, bro." body. |
| | | ``notfound`` view will be called and it will return a "Not found" body. |
| | | |
| | | If a request enters the application with the ``PATH_INFO`` value of |
| | | ``/has_slash/``, the second route will match. If a request enters the |
| | |
| | | |
| | | @notfound_view_config(append_slash=True) |
| | | def notfound(request): |
| | | return HTTPNotFound('Not found, bro.') |
| | | return HTTPNotFound() |
| | | |
| | | @view_config(route_name='noslash') |
| | | def no_slash(request): |
| | |
| | | |
| | | @notfound_view_config() |
| | | def notfound(request): |
| | | return Response('Not found, dude!', status='404 Not Found') |
| | | return Response('Not found!', status='404 Not Found') |
| | | |
| | | All arguments except ``append_slash`` have the same meaning as |
| | | :meth:`pyramid.view.view_config` and each predicate |