From 29a850643aea9452c4f09906505812cb03d7ef5c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 00:52:27 -0400 Subject: - When visiting a URL that represented a static view which resolved to a subdirectory, the ``index.html`` of that subdirectory would not be served properly. Instead, a redirect to ``/subdir`` would be issued. This has been fixed, and now visiting a subdirectory that contains an ``index.html`` within a static view returns the index.html properly. See also https://github.com/Pylons/pyramid/issues/67. - Redirects issued by a static view did not take into account any existing ``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. Closes #67. --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 0bd19572a..3ae834d93 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -104,6 +104,16 @@ Bug Fixes DummyRequest instead of eagerly assigning an attribute. See also https://github.com/Pylons/pyramid/issues/165 +- When visiting a URL that represented a static view which resolved to a + subdirectory, the ``index.html`` of that subdirectory would not be served + properly. Instead, a redirect to ``/subdir`` would be issued. This has + been fixed, and now visiting a subdirectory that contains an ``index.html`` + within a static view returns the index.html properly. See also + https://github.com/Pylons/pyramid/issues/67. + +- Redirects issued by a static view did not take into account any existing + ``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. + 1.0 (2011-01-30) ================ -- cgit v1.2.3 From a7b1a933a263ee99426fda642c379d942f8f852b Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 17:07:38 -0400 Subject: - Deprecated all assignments to ``request.response_*`` attributes such as ``request.response_content_type = 'foo'``. Assignments and mutations of the following request attributes that were considered by the framework for response influence are now deprecated: ``response_content_type``, ``response_headerlist``, ``response_status``, ``response_charset``, and ``response_cache_for``. Instead of assigning these to the request object for detection by the rendering machinery, users should use the appropriate API of the Response object created by accessing ``request.response`` (e.g. ``request.response_content_type = 'abc'`` -> ``request.response.content_type = 'abc'``). - Custom request objects are now required to have a ``response`` attribute (or reified property) if they are meant to be used with renderers. This ``response`` attribute should be an instance of the class ``pyramid.response.Response``. - The JSON and string renderer factories now use ``request.response.content_type`` rather than ``request.response_content_type``. They determine whether they should set the content type of the response by comparing the response's content type against the default (usually ``text/html``); if the content type is not the default, the renderer changes the content type (to ``application/json`` or ``text/plain`` for JSON and string renderers respectively). - Made it possible to assign to and delete ``pyramid.testing.DummyRequest.registry`` (bugfix). --- CHANGES.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 3ae834d93..e613e021d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,36 @@ Next release ============ +Requestresponse branch +---------------------- + +- Deprecated all assignments to ``request.response_*`` attributes such as + ``request.response_content_type = 'foo'``. Assignments and mutations of + the following request attributes that were considered by the framework for + response influence are now deprecated: ``response_content_type``, + ``response_headerlist``, ``response_status``, ``response_charset``, and + ``response_cache_for``. Instead of assigning these to the request object + for detection by the rendering machinery, users should use the appropriate + API of the Response object created by accessing ``request.response`` + (e.g. ``request.response_content_type = 'abc'`` -> + ``request.response.content_type = 'abc'``). + +- Custom request objects are now required to have a ``response`` attribute + (or reified property) if they are meant to be used with renderers. This + ``response`` attribute should be an instance of the class + ``pyramid.response.Response``. + +- The JSON and string renderer factories now use + ``request.response.content_type`` rather than + ``request.response_content_type``. They determine whether they should set + the content type of the response by comparing the response's content type + against the default (usually ``text/html``); if the content type is not the + default, the renderer changes the content type (to ``application/json`` or + ``text/plain`` for JSON and string renderers respectively). + +- Made it possible to assign to and delete + ``pyramid.testing.DummyRequest.registry`` (bugfix). + Documentation ------------- -- cgit v1.2.3 From d07e169f89ead3ce41ae35a6c30df2964685c93e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 22:28:11 -0400 Subject: garden change message --- CHANGES.txt | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index e613e021d..38bdd382d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,28 +4,31 @@ Next release Requestresponse branch ---------------------- -- Deprecated all assignments to ``request.response_*`` attributes such as - ``request.response_content_type = 'foo'``. Assignments and mutations of - the following request attributes that were considered by the framework for - response influence are now deprecated: ``response_content_type``, - ``response_headerlist``, ``response_status``, ``response_charset``, and - ``response_cache_for``. Instead of assigning these to the request object - for detection by the rendering machinery, users should use the appropriate - API of the Response object created by accessing ``request.response`` - (e.g. ``request.response_content_type = 'abc'`` -> +- Deprecated all assignments to ``request.response_*`` attributes (for + example ``request.response_content_type = 'foo'`` is now deprecated). + Assignments and mutations of the following assignable request attributes + that were considered by the framework for response influence are now + deprecated: ``response_content_type``, ``response_headerlist``, + ``response_status``, ``response_charset``, and ``response_cache_for``. + Instead of assigning these to the request object for later detection by the + rendering machinery, users should use the appropriate API of the Response + object created by accessing ``request.response`` (e.g. code which does + ``request.response_content_type = 'abc'`` should be changed to ``request.response.content_type = 'abc'``). -- Custom request objects are now required to have a ``response`` attribute - (or reified property) if they are meant to be used with renderers. This +- A custom request factory is now required to return a response object that + has a ``response`` attribute (or "reified"/lazy property) if they the + request is meant to be used in a view that uses a renderer. This ``response`` attribute should be an instance of the class ``pyramid.response.Response``. -- The JSON and string renderer factories now use +- The JSON and string renderer factories now assign to ``request.response.content_type`` rather than - ``request.response_content_type``. They determine whether they should set - the content type of the response by comparing the response's content type - against the default (usually ``text/html``); if the content type is not the - default, the renderer changes the content type (to ``application/json`` or + ``request.response_content_type``. Each renderer factory adetermines + whether it should change the content type of the response by comparing the + response's content type against the response's default content type; if the + content type is not the default content type (usually ``text/html``), the + renderer changes the content type (to ``application/json`` or ``text/plain`` for JSON and string renderers respectively). - Made it possible to assign to and delete -- cgit v1.2.3 From 0f7831e3ee2d8504120005bd82cc0eb03d39c73d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 23:18:58 -0400 Subject: - Pyramid now depends on WebOb >= 1.0.2 (tests depend on the bugfix in that release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``"). (Note that in reality, everyone should probably be using 1.0.4 or better though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.) --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 3ae834d93..a59218eff 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -114,6 +114,14 @@ Bug Fixes - Redirects issued by a static view did not take into account any existing ``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. +Dependencies +------------ + +- Pyramid now depends on WebOb >= 1.0.2 (tests depend on the bugfix in that + release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``"). + (Note that in reality, everyone should probably be using 1.0.4 or better + though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.) + 1.0 (2011-01-30) ================ -- cgit v1.2.3 From dad904380fd3f53a82e5c48316cc0e7bfa199b74 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 23:20:22 -0400 Subject: Fix parens. --- CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index a59218eff..66103fbc1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -117,8 +117,8 @@ Bug Fixes Dependencies ------------ -- Pyramid now depends on WebOb >= 1.0.2 (tests depend on the bugfix in that - release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``"). +- Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that + release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``". (Note that in reality, everyone should probably be using 1.0.4 or better though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.) -- cgit v1.2.3 From 4d92609add1da64fb50afdd634b87186b94f6a95 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Apr 2011 23:47:44 -0400 Subject: merge requestresponse section into various changes subsections --- CHANGES.txt | 72 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 33 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 83d71e2b7..5f450fdcd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,39 +1,6 @@ Next release ============ -Requestresponse branch ----------------------- - -- Deprecated all assignments to ``request.response_*`` attributes (for - example ``request.response_content_type = 'foo'`` is now deprecated). - Assignments and mutations of the following assignable request attributes - that were considered by the framework for response influence are now - deprecated: ``response_content_type``, ``response_headerlist``, - ``response_status``, ``response_charset``, and ``response_cache_for``. - Instead of assigning these to the request object for later detection by the - rendering machinery, users should use the appropriate API of the Response - object created by accessing ``request.response`` (e.g. code which does - ``request.response_content_type = 'abc'`` should be changed to - ``request.response.content_type = 'abc'``). - -- A custom request factory is now required to return a response object that - has a ``response`` attribute (or "reified"/lazy property) if they the - request is meant to be used in a view that uses a renderer. This - ``response`` attribute should be an instance of the class - ``pyramid.response.Response``. - -- The JSON and string renderer factories now assign to - ``request.response.content_type`` rather than - ``request.response_content_type``. Each renderer factory adetermines - whether it should change the content type of the response by comparing the - response's content type against the response's default content type; if the - content type is not the default content type (usually ``text/html``), the - renderer changes the content type (to ``application/json`` or - ``text/plain`` for JSON and string renderers respectively). - -- Made it possible to assign to and delete - ``pyramid.testing.DummyRequest.registry`` (bugfix). - Documentation ------------- @@ -61,6 +28,12 @@ Documentation Features -------- +- Accessing the ``response`` attribute of a ``pyramid.request.Request`` + object (e.g. ``request.response`` within a view) now produces a new + ``pyramid.response.Response`` object. This feature is meant to be used + mainly when a view configured with a renderer needs to set response + attributes, but it can be used by any code. + - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url`` or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context, request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be @@ -147,6 +120,39 @@ Bug Fixes - Redirects issued by a static view did not take into account any existing ``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. +Deprecations +------------ + +- Deprecated all assignments to ``request.response_*`` attributes (for + example ``request.response_content_type = 'foo'`` is now deprecated). + Assignments and mutations of assignable request attributes that were + considered by the framework for response influence are now deprecated: + ``response_content_type``, ``response_headerlist``, ``response_status``, + ``response_charset``, and ``response_cache_for``. Instead of assigning + these to the request object for later detection by the rendering machinery, + users should use the appropriate API of the Response object created by + accessing ``request.response`` (e.g. code which does + ``request.response_content_type = 'abc'`` should be changed to + ``request.response.content_type = 'abc'``). + +Behavior Changes +---------------- + +- A custom request factory is now required to return a response object that + has a ``response`` attribute (or "reified"/lazy property) if they the + request is meant to be used in a view that uses a renderer. This + ``response`` attribute should be an instance of the class + ``pyramid.response.Response``. + +- The JSON and string renderer factories now assign to + ``request.response.content_type`` rather than + ``request.response_content_type``. Each renderer factory determines + whether it should change the content type of the response by comparing the + response's content type against the response's default content type; if the + content type is not the default content type (usually ``text/html``), the + renderer changes the content type (to ``application/json`` or + ``text/plain`` for JSON and string renderers respectively). + Dependencies ------------ -- cgit v1.2.3 From be603e3f95fc42385783aa4bbfff132e4ea062c0 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 19 Apr 2011 00:05:24 -0400 Subject: clarify --- CHANGES.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5f450fdcd..affacb7d4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -32,7 +32,9 @@ Features object (e.g. ``request.response`` within a view) now produces a new ``pyramid.response.Response`` object. This feature is meant to be used mainly when a view configured with a renderer needs to set response - attributes, but it can be used by any code. + attributes, but it can be used by any code to produce a response object + (although the response object produced must still be returned unless a + renderer is used). - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url`` or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context, -- cgit v1.2.3 From e39ddf10c908d176915da23a6bd209e46815d3c0 Mon Sep 17 00:00:00 2001 From: Juliusz Gonera Date: Tue, 19 Apr 2011 11:21:19 +0200 Subject: replacement for torturous_route_re, inner squigglies work again --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 3ae834d93..15ec0d8e0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -64,6 +64,16 @@ Features Bug Fixes --------- +- URL pattern markers used in URL dispatch are permitted to specify a custom + regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345`` + (foo==12345 in the match dictionary) but not ``/abc``. However, custom + regexes in a pattern marker which used squiggly brackets did not work. For + example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and + ``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of + inner squiggly brackets is now recognized so that the prior two patterns + given as examples now work. See also + https://github.com/Pylons/pyramid/issues/#issue/123. + - Don't send port numbers along with domain information in cookies set by AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131). -- cgit v1.2.3 From db51c08cda155ae5d9921c62700ab813f58f5d72 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 19 Apr 2011 15:00:57 -0400 Subject: rendering --- CHANGES.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index affacb7d4..092423bc1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -32,9 +32,13 @@ Features object (e.g. ``request.response`` within a view) now produces a new ``pyramid.response.Response`` object. This feature is meant to be used mainly when a view configured with a renderer needs to set response - attributes, but it can be used by any code to produce a response object - (although the response object produced must still be returned unless a - renderer is used). + attributes: all renderers will use the Response object implied by + ``request.response`` as the response object returned to the router. + + ``request.response`` can also be used by code in a view that does not use a + renderer, however the response object that is produced by + ``request.response`` must be returned when a renderer is not in play (it is + not a "global" response). - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url`` or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context, -- cgit v1.2.3 From f6799bbb6e9aca55f344f5d7f49f8fcb7af13db4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Apr 2011 11:57:53 -0400 Subject: add 'adding a custom settings' --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5f08606be..c3bdd54ef 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -25,6 +25,10 @@ Documentation ``pyramid.config.Configurator.set_view_mapper`` and refer to it within Hooks chapter section named "Using a View Mapper". +- Added section to the "Environment Variables and ``.ini`` File Settings" + chapter in the narrative documentation section entitled "Adding a Custom + Setting". + Features -------- -- cgit v1.2.3 From ba0a5f88d916d97fe52540a535b8b5520815201a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Apr 2011 23:42:51 -0400 Subject: add changelog entries, fix docs for wsgiapp2 --- CHANGES.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5f08606be..c8b264587 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -136,6 +136,13 @@ Bug Fixes - Redirects issued by a static view did not take into account any existing ``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. +- The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the + ``SCRIPT_NAME`` in the origin request. + +- The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it + decorated a view found via traversal; it ignored the ``PATH_INFO`` that was + part of a url-dispatch-matched view. + Deprecations ------------ @@ -169,6 +176,12 @@ Behavior Changes renderer changes the content type (to ``application/json`` or ``text/plain`` for JSON and string renderers respectively). +- The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of + figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the + downstream application. As a result, those values may differ slightly from + the perspective of the downstream application (for example, ``SCRIPT_NAME`` + will now never possess a trailing slash). + Dependencies ------------ -- cgit v1.2.3 From ed7ffe0e2065100f551793b3774656d8bdde0fb0 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 22 Apr 2011 13:42:19 -0400 Subject: - Make sure deprecation warnings aren't raised when tests are run. - Modify documentation for cross-referencing. - Use add_view(viewname) syntax rather than add_view(view=viewname) syntax for normalization. - Use warnings.warn rather than zope.deprecated in order to make testing easier. - Move tests which test deprecated methods of configurator to a separate test case. --- CHANGES.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index c0108ff3a..9e967e5c5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -162,6 +162,30 @@ Deprecations ``request.response_content_type = 'abc'`` should be changed to ``request.response.content_type = 'abc'``). +- Passing view-related parameters to + ``pyramid.config.Configurator.add_route`` is now deprecated. Previously, a + view was permitted to be connected to a route using a set of ``view*`` + parameters passed to the ``add_route`` method of the Configurator. This + was a shorthand which replaced the need to perform a subsequent call to + ``add_view``. For example, it was valid (and often recommended) to do:: + + config.add_route('home', '/', view='mypackage.views.myview', + view_renderer='some/renderer.pt') + + Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of + connecting a view to a predefined route via ``Configurator.add_view`` using + the route's ``route_name`` parameter. As a result, the above example + should now be spelled:: + + config.add_route('home', '/') + config.add_view('mypackage.views.myview', route_name='home') + renderer='some/renderer.pt') + + This deprecation was done to reduce confusion observed in IRC, as well as + to (eventually) reduce documentation burden. A deprecation warning is now + issued when any view-related parameter is passed to + ``Configurator.add_route``. + Behavior Changes ---------------- -- cgit v1.2.3 From bf8c8f7c8e88e81a9f8c75c435c28e6269df049c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 22 Apr 2011 14:04:22 -0400 Subject: reference an issue --- CHANGES.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 9e967e5c5..d329c260d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -182,8 +182,9 @@ Deprecations renderer='some/renderer.pt') This deprecation was done to reduce confusion observed in IRC, as well as - to (eventually) reduce documentation burden. A deprecation warning is now - issued when any view-related parameter is passed to + to (eventually) reduce documentation burden (see also + https://github.com/Pylons/pyramid/issues/164). A deprecation warning is + now issued when any view-related parameter is passed to ``Configurator.add_route``. Behavior Changes -- cgit v1.2.3