diff options
Diffstat (limited to 'CHANGES.txt')
| -rw-r--r-- | CHANGES.txt | 345 |
1 files changed, 341 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 0eb02baad..208662150 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,10 +4,324 @@ Next release Features -------- -- New request attribute: ``json``. If the request's ``content_type`` is - ``application/json``, this attribute will contain the JSON-decoded - variant of the request body. If the request's ``content_type`` is not - ``application/json``, this attribute will be ``None``. +- Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in + ``permission=`` statements to view configuration. This constant has a + value of the string ``__no_permission_required__``. This string value was + previously referred to in documentation; now the documentation uses the + constant. + +- Added a decorator-based way to configure a response adapter: + ``pyramid.response.response_adapter``. This decorator has the same use as + ``pyramid.config.Configurator.add_response_adapter`` but it's declarative. + +- The ``pyramid.events.BeforeRender`` event now has an attribute named + ``rendering_val``. This can be used to introspect the value returned by a + view in a BeforeRender subscriber. + +- New configurator directive: ``pyramid.config.Configurator.add_tween``. + This directive adds a "tween". A "tween" is used to wrap the Pyramid + router's primary request handling function. This is a feature may be used + by Pyramid framework extensions, to provide, for example, view timing + support and as a convenient place to hang bookkeeping code. + + Tweens are further described in the narrative docs section in the Hooks + chapter, named "Registering Tweens". + +- New paster command ``paster ptweens``, which prints the current "tween" + configuration for an application. See the section entitled "Displaying + Tweens" in the Command-Line Pyramid chapter of the narrative documentation + for more info. + +- The Pyramid debug logger now uses the standard logging configuration + (usually set up by Paste as part of startup). This means that output from + e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the + normal logging channels. The logger name of the debug logger will be the + package name of the *caller* of the Configurator's constructor. + +- A new attribute is available on request objects: ``exc_info``. Its value + will be ``None`` until an exception is caught by the Pyramid router, after + which it will be the result of ``sys.exc_info()``. + +Internal +-------- + +- The Pyramid "exception view" machinery is now implemented as a "tween" + (``pyramid.tweens.excview_tween_factory``). + +Deprecations +------------ + +- All Pyramid-related deployment settings (e.g. ``debug_all``, + ``debug_notfound``) are now meant to be prefixed with the prefix + ``pyramid.``. For example: ``debug_all`` -> ``pyramid.debug_all``. The + old non-prefixed settings will continue to work indefinitely but supplying + them may print a deprecation warning. All scaffolds and tutorials have + been changed to use prefixed settings. + +Backwards Incompatibilities +--------------------------- + +- If a string is passed as the ``debug_logger`` parameter to a Configurator, + that string is considered to be the name of a global Python logger rather + than a dotted name to an instance of a logger. + +Documentation +------------- + +- Added a new module to the API docs: ``pyramid.tweens``. + +- Added a "Registering Tweens" section to the "Hooks" narrative chapter. + +- Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative + chapter. + +Bug Fixes +--------- + +- Fixed an issue with the default renderer not working at certain times. See + https://github.com/Pylons/pyramid/issues/249 + +1.1 (2011-07-22) +================ + +Features +-------- + +- Added the ``pyramid.renderers.null_renderer`` object as an API. The null + renderer is an object that can be used in advanced integration cases as + input to the view configuration ``renderer=`` argument. When the null + renderer is used as a view renderer argument, Pyramid avoids converting the + view callable result into a Response object. This is useful if you want to + reuse the view configuration and lookup machinery outside the context of + its use by the Pyramid router. This feature was added for consumption by + the ``pyramid_rpc`` package, which uses view configuration and lookup + outside the context of a router in exactly this way. ``pyramid_rpc`` has + been broken under 1.1 since 1.1b1; adding it allows us to make it work + again. + +- Change all scaffolding templates that point to docs.pylonsproject.org to + use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``. + +Internals +--------- + +- Remove ``compat`` code that served only the purpose of providing backwards + compatibility with Python 2.4. + +- Add a deprecation warning for non-API function + ``pyramid.renderers.renderer_from_name`` which has seen use in the wild. + +- Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by + the ``pyramid.view.view_config`` decorator. + +Documentation +------------- + +- Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial. + +- Reordered chapters in narrative section for better new user friendliness. + +- Added more indexing markers to sections in documentation. + +1.1b4 (2011-07-18) +================== + +Documentation +------------- + +- Added a section entitled "Writing a Script" to the "Command-Line Pyramid" + chapter. + +Backwards Incompatibilities +--------------------------- + +- We added the ``pyramid.scripting.make_request`` API too hastily in 1.1b3. + It has been removed. Sorry for any inconvenience. Use the + ``pyramid.request.Request.blank`` API instead. + +Features +-------- + +- The ``paster pshell``, ``paster pviews``, and ``paster proutes`` commands + each now under the hood uses ``pyramid.paster.bootstrap``, which makes it + possible to supply an ``.ini`` file without naming the "right" section in + the file that points at the actual Pyramid application. Instead, you can + generally just run ``paster {pshell|proutes|pviews} development.ini`` and + it will do mostly the right thing. + +Bug Fixes +--------- + +- Omit custom environ variables when rendering a custom exception template in + ``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``; + stringifying thse may trigger code that should not be executed; see + https://github.com/Pylons/pyramid/issues/239 + +1.1b3 (2011-07-15) +================== + +Features +-------- + +- Fix corner case to ease semifunctional testing of views: create a new + rendererinfo to clear out old registry on a rescan. See + https://github.com/Pylons/pyramid/pull/234. + +- New API class: ``pyramid.static.static_view``. This supersedes the + deprecated ``pyramid.view.static`` class. ``pyramid.static.static_view`` + by default serves up documents as the result of the request's + ``path_info``, attribute rather than it's ``subpath`` attribute (the + inverse was true of ``pyramid.view.static``, and still is). + ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when + you want the static view to behave like the older deprecated version. + +- A new API function ``pyramid.paster.bootstrap`` has been added to make + writing scripts that bootstrap a Pyramid environment easier, e.g.:: + + from pyramid.paster import bootstrap + info = bootstrap('/path/to/my/development.ini') + request = info['request'] + print request.route_url('myroute') + +- A new API function ``pyramid.scripting.prepare`` has been added. It is a + lower-level analogue of ``pyramid.paster.boostrap`` that accepts a request + and a registry instead of a config file argument, and is used for the same + purpose:: + + from pyramid.scripting import prepare + info = prepare(registry=myregistry) + request = info['request'] + print request.route_url('myroute') + +- A new API function ``pyramid.scripting.make_request`` has been added. The + resulting request will have a ``registry`` attribute. It is meant to be + used in conjunction with ``pyramid.scripting.prepare`` and/or + ``pyramid.paster.bootstrap`` (both of which accept a request as an + argument):: + + from pyramid.scripting import make_request + request = make_request('/') + +- New API attribute ``pyramid.config.global_registries`` is an iterable + object that contains references to every Pyramid registry loaded into the + current process via ``pyramid.config.Configurator.make_app``. It also has + a ``last`` attribute containing the last registry loaded. This is used by + the scripting machinery, and is available for introspection. + +Deprecations +------------ + +- The ``pyramid.view.static`` class has been deprecated in favor of the newer + ``pyramid.static.static_view`` class. A deprecation warning is raised when + it is used. You should replace it with a reference to + ``pyramid.static.static_view`` with the ``use_subpath=True`` argument. + +Bug Fixes +--------- + +- Without a mo-file loaded for the combination of domain/locale, + ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale + combination raised an inscrutable "translations object has no attr + 'plural'" error. Now, instead it "works" (it uses a germanic pluralization + by default). It's nonsensical to try to pluralize something without + translations for that locale/domain available, but this behavior matches + the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least + consistent; see https://github.com/Pylons/pyramid/issues/235. + +1.1b2 (2011-07-13) +================== + +Features +-------- + +- New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new + configuration file value ``prevent_http_cache``. These are synomymous and + allow you to prevent HTTP cache headers from being set by Pyramid's + ``http_cache`` machinery globally in a process. see the "Influencing HTTP + Caching" section of the "View Configuration" narrative chapter and the + detailed documentation for this setting in the "Environment Variables and + Configuration Settings" narrative chapter. + +Behavior Changes +---------------- + +- Previously, If a ``BeforeRender`` event subscriber added a value via the + ``__setitem__`` or ``update`` methods of the event object with a key that + already existed in the renderer globals dictionary, a ``KeyError`` was + raised. With the deprecation of the "add_renderer_globals" feature of the + configurator, there was no way to override an existing value in the + renderer globals dictionary that already existed. Now, the event object + will overwrite an older value that is already in the globals dictionary + when its ``__setitem__`` or ``update`` is called (as well as the new + ``setdefault`` method), just like a plain old dictionary. As a result, for + maximum interoperability with other third-party subscribers, if you write + an event subscriber meant to be used as a BeforeRender subscriber, your + subscriber code will now need to (using ``.get`` or ``__contains__`` of the + event object) ensure no value already exists in the renderer globals + dictionary before setting an overriding value. + +Bug Fixes +--------- + +- The ``Configurator.add_route`` method allowed two routes with the same + route to be added without an intermediate ``config.commit()``. If you now + receive a ``ConfigurationError`` at startup time that appears to be + ``add_route`` related, you'll need to either a) ensure that all of your + route names are unique or b) call ``config.commit()`` before adding a + second route with the name of a previously added name or c) use a + Configurator that works in ``autocommit`` mode. + +- The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds + inappropriately used ``DBSession.rollback()`` instead of + ``transaction.abort()`` in one place. + +- We now clear ``request.response`` before we invoke an exception view; an + exception view will be working with a request.response that has not been + touched by any code prior to the exception. + +- Views associated with routes with spaces in the route name may not have + been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4 + and better. See https://github.com/Pylons/pyramid/issues/232. + +Documentation +------------- + +- Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't + match the ``pyramid_routesalchemy`` scaffold function of the same name; it + didn't get synchronized when it was changed in the scaffold. + +- New documentation section in View Configuration narrative chapter: + "Influencing HTTP Caching". + +1.1b1 (2011-07-10) +================== + +Features +-------- + +- It is now possible to invoke ``paster pshell`` even if the paste ini file + section name pointed to in its argument is not actually a Pyramid WSGI + application. The shell will work in a degraded mode, and will warn the + user. See "The Interactive Shell" in the "Creating a Pyramid Project" + narrative documentation section. + +- ``paster pshell`` now offers more built-in global variables by default + (including ``app`` and ``settings``). See "The Interactive Shell" in the + "Creating a Pyramid Project" narrative documentation section. + +- It is now possible to add a ``[pshell]`` section to your application's .ini + configuration file, which influences the global names available to a pshell + session. See "Extending the Shell" in the "Creating a Pyramid Project" + narrative documentation chapter. + +- The ``config.scan`` method has grown a ``**kw`` argument. ``kw`` argument + represents a set of keyword arguments to pass to the Venusian ``Scanner`` + object created by Pyramid. (See the Venusian documentation for more + information about ``Scanner``). + +- New request property: ``json_body``. This property will return the + JSON-decoded variant of the request body. If the request body is not + well-formed JSON, this property will raise an exception. - A new value ``http_cache`` can be used as a view configuration parameter. @@ -60,6 +374,29 @@ Features to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache`` with the first element of ``None``, e.g.: ``(None, {'public':True})``. +Bug Fixes +--------- + +- Framework wrappers of the original view (such as http_cached and so on) + relied on being able to trust that the response they were receiving was an + IResponse. It wasn't always, because the response was resolved by the + router instead of early in the view wrapping process. This has been fixed. + +Documentation +------------- + +- Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded + Request Body" (usage of ``request.json_body``). + +Behavior Changes +---------------- + +- The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands + now take a single argument in the form ``/path/to/config.ini#sectionname`` + rather than the previous 2-argument spelling ``/path/to/config.ini + sectionname``. ``#sectionname`` may be omitted, in which case ``#main`` is + assumed. + 1.1a4 (2011-07-01) ================== |
