summaryrefslogtreecommitdiff
path: root/CHANGES.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CHANGES.txt')
-rw-r--r--CHANGES.txt115
1 files changed, 115 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 0bd19572a..d329c260d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -25,9 +25,25 @@ 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
--------
+- 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: 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,
request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be
@@ -64,6 +80,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).
@@ -104,6 +130,95 @@ 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.
+
+- 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
+------------
+
+- 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'``).
+
+- 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 (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
+----------------
+
+- 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).
+
+- 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
+------------
+
+- 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.)
+
1.0 (2011-01-30)
================