From 1ffb8e3cc21603b29ccd78152f82cca7f61a09b1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 16 May 2011 02:11:56 -0400 Subject: - Added API docs for ``pyramid.httpexceptions.abort`` and ``pyramid.httpexceptions.redirect``. - Added "HTTP Exceptions" section to Views narrative chapter including a description of ``pyramid.httpexceptions.abort``; adjusted redirect section to note ``pyramid.httpexceptions.redirect``. - A default exception view for the context ``webob.exc.HTTPException`` (aka ``pyramid.httpexceptions.HTTPException``) is now registered by default. This means that an instance of any exception class imported from ``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from within view code; when raised, this exception view will render the exception to a response. - New functions named ``pyramid.httpexceptions.abort`` and ``pyramid.httpexceptions.redirect`` perform the equivalent of their Pylons brethren when an HTTP exception handler is registered. These functions take advantage of the newly registered exception view for ``webob.exc.HTTPException``. - The Configurator now accepts an additional keyword argument named ``httpexception_view``. By default, this argument is populated with a default exception view function that will be used when an HTTP exception is raised. When ``None`` is passed for this value, an exception view for HTTP exceptions will not be registered. Passing ``None`` returns the behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception will propagate to middleware and to the WSGI server). --- TODO.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 0f7d6342c..d85f3b7f0 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,10 +4,6 @@ Pyramid TODOs Should-Have ----------- -- Consider adding a default exception view for HTTPException and attendant - ``redirect`` and ``abort`` functions ala Pylons (promised Mike I'd enable - this in 1.1). - - Add narrative docs for wsgiapp and wsgiapp2. Nice-to-Have -- cgit v1.2.3 From 99edc51a3b05309c7f5d98ff96289ec51b1d7660 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 11 Jun 2011 05:35:27 -0400 Subject: - Pyramid now expects Response objects to have a __call__ method which implements the WSGI application interface instead of the three webob attrs status, headerlist and app_iter. Backwards compatibility exists for code which returns response objects that do not have a __call__. - pyramid.response.Response is no longer an exception (and therefore cannot be raised in order to generate a response). - Changed my mind about moving stuff from pyramid.httpexceptions to pyramid.response. The stuff I moved over has been moved back to pyramid.httpexceptions. --- TODO.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index d85f3b7f0..04c6e60d7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,12 @@ Pyramid TODOs ============= +Must-Have +--------- + +- Depend on only __call__ interface or only 3-attr interface in builtin code + that deals with response objects. + Should-Have ----------- -- cgit v1.2.3 From fc048afce7c58a1e794b495b438f4ee76f084b69 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 11 Jun 2011 05:42:43 -0400 Subject: todo --- TODO.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 04c6e60d7..1a178a23d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -7,6 +7,11 @@ Must-Have - Depend on only __call__ interface or only 3-attr interface in builtin code that deals with response objects. +- Figure out what to do with ``is_response``. + +- Docs mention ``exception.args[0]`` as a way to get messages; check that + this works. + Should-Have ----------- -- cgit v1.2.3 From f0d77e8f3cec1ff90a2029fe143580fd42cf81aa Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 11 Jun 2011 05:45:15 -0400 Subject: todo --- TODO.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 1a178a23d..4b82208bd 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,6 +4,8 @@ Pyramid TODOs Must-Have --------- +- To subclass or not subclass http exceptions. + - Depend on only __call__ interface or only 3-attr interface in builtin code that deals with response objects. -- cgit v1.2.3 From d868fff7597c5a05acd1f5c024fc45dde9880413 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 13 Jun 2011 06:17:00 -0400 Subject: - Remove IResponder abstraction in favor of more general IResponse abstraction. - It is now possible to return an arbitrary object from a Pyramid view callable even if a renderer is not used, as long as a suitable adapter to ``pyramid.interfaces.IResponse`` is registered for the type of the returned object. See the section in the Hooks chapter of the documentation entitled "Changing How Pyramid Treats View Responses". - The Pyramid router now, by default, expects response objects returned from view callables to implement the ``pyramid.interfaces.IResponse`` interface. Unlike the Pyramid 1.0 version of this interface, objects which implement IResponse now must define a ``__call__`` method that accepts ``environ`` and ``start_response``, and which returns an ``app_iter`` iterable, among other things. Previously, it was possible to return any object which had the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as a response, so this is a backwards incompatibility. It is possible to get backwards compatibility back by registering an adapter to IResponse from the type of object you're now returning from view callables. See the section in the Hooks chapter of the documentation entitled "Changing How Pyramid Treats View Responses". - The ``pyramid.interfaces.IResponse`` interface is now much more extensive. Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now it is basically intended to directly mirror the ``webob.Response`` API, which has many methods and attributes. - Documentation changes to support above. --- TODO.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 4b82208bd..ca2433d3c 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,14 +6,27 @@ Must-Have - To subclass or not subclass http exceptions. -- Depend on only __call__ interface or only 3-attr interface in builtin code - that deals with response objects. +- Flesh out IResponse interface. Attributes Used internally: unicode_body / + body / content_type / charset / cache_expires / headers/ + default_content_type / set_cookie / headerlist / app_iter / status / + __call__. -- Figure out what to do with ``is_response``. +- Deprecate view.is_response? + +- Move is_response to response.py? + +- Make sure registering IResponse adapter for webob.Response doesn't make it + impossible to register an IResponse adapter for an interface that a + webob.Response happens to implement. + +- Run whatsitdoing tests. - Docs mention ``exception.args[0]`` as a way to get messages; check that this works. +- Deprecate response_foo attrs on request at attribute set time rather than + lookup time. + Should-Have ----------- -- cgit v1.2.3 From 3f4f67e76c2e1338377babd983e4071f52235132 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 13 Jun 2011 23:05:38 -0400 Subject: garden --- TODO.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index ca2433d3c..9d9bbf1eb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,15 +6,12 @@ Must-Have - To subclass or not subclass http exceptions. -- Flesh out IResponse interface. Attributes Used internally: unicode_body / - body / content_type / charset / cache_expires / headers/ - default_content_type / set_cookie / headerlist / app_iter / status / - __call__. - - Deprecate view.is_response? - Move is_response to response.py? +- Create add_response_adapter Configurator API? + - Make sure registering IResponse adapter for webob.Response doesn't make it impossible to register an IResponse adapter for an interface that a webob.Response happens to implement. -- cgit v1.2.3 From 92099080859976ce78882de477ddc2c01bc880b2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 14 Jun 2011 03:37:08 -0400 Subject: - New method named ``pyramid.request.Request.is_response``. This method should be used instead of the ``pyramid.view.is_response`` function, which has been deprecated. - Deprecated ``pyramid.view.is_response`` function in favor of (newly-added) ``pyramid.request.Request.is_response`` method. Determining if an object is truly a valid response object now requires access to the registry, which is only easily available as a request attribute. The ``pyramid.view.is_response`` function will still work until it is removed, but now may return an incorrect answer under some (very uncommon) circumstances. --- TODO.txt | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 9d9bbf1eb..27ab9ffb5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,18 +6,6 @@ Must-Have - To subclass or not subclass http exceptions. -- Deprecate view.is_response? - -- Move is_response to response.py? - -- Create add_response_adapter Configurator API? - -- Make sure registering IResponse adapter for webob.Response doesn't make it - impossible to register an IResponse adapter for an interface that a - webob.Response happens to implement. - -- Run whatsitdoing tests. - - Docs mention ``exception.args[0]`` as a way to get messages; check that this works. -- cgit v1.2.3 From cecfc9e459166f3de13141954a61eaa2d6c905f2 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 14 Jun 2011 05:29:45 -0400 Subject: garden: --- TODO.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 27ab9ffb5..fb72d42b5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,7 +4,8 @@ Pyramid TODOs Must-Have --------- -- To subclass or not subclass http exceptions. +- Copy exception templates from webob.exc into pyramid.httpexceptions and + ensure they all work. - Docs mention ``exception.args[0]`` as a way to get messages; check that this works. -- cgit v1.2.3