Chris McDonough
2011-09-04 90737d6b24775cab3a3816b426c0dc65c03fe43d
commit | author | age
bd9947 1 1.1 (2011-07-22)
CM 2 ================
3
4 Features
5 --------
6
7 - Added the ``pyramid.renderers.null_renderer`` object as an API.  The null
8   renderer is an object that can be used in advanced integration cases as
9   input to the view configuration ``renderer=`` argument.  When the null
10   renderer is used as a view renderer argument, Pyramid avoids converting the
11   view callable result into a Response object.  This is useful if you want to
12   reuse the view configuration and lookup machinery outside the context of
13   its use by the Pyramid router.  This feature was added for consumption by
14   the ``pyramid_rpc`` package, which uses view configuration and lookup
15   outside the context of a router in exactly this way.  ``pyramid_rpc`` has
16   been broken under 1.1 since 1.1b1; adding it allows us to make it work
17   again.
18
19 - Change all scaffolding templates that point to docs.pylonsproject.org to
20   use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``.
21
22 Internals
23 ---------
24
25 - Remove ``compat`` code that served only the purpose of providing backwards
26   compatibility with Python 2.4.
27
28 - Add a deprecation warning for non-API function
29   ``pyramid.renderers.renderer_from_name`` which has seen use in the wild.
30
31 - Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by
32   the ``pyramid.view.view_config`` decorator.
33
34 Documentation
35 -------------
36
37 - Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial.
38
39 - Reordered chapters in narrative section for better new user friendliness.
40
41 - Added more indexing markers to sections in documentation.
42
43 1.1b4 (2011-07-18)
44 ==================
45
46 Documentation
47 -------------
48
49 - Added a section entitled "Writing a Script" to the "Command-Line Pyramid"
50   chapter.
51
52 Backwards Incompatibilities
53 ---------------------------
54
55 - We added the ``pyramid.scripting.make_request`` API too hastily in 1.1b3.
56   It has been removed.  Sorry for any inconvenience.  Use the
57   ``pyramid.request.Request.blank`` API instead.
58
59 Features
60 --------
61
62 - The ``paster pshell``, ``paster pviews``, and ``paster proutes`` commands
63   each now under the hood uses ``pyramid.paster.bootstrap``, which makes it
64   possible to supply an ``.ini`` file without naming the "right" section in
65   the file that points at the actual Pyramid application.  Instead, you can
66   generally just run ``paster {pshell|proutes|pviews} development.ini`` and
67   it will do mostly the right thing.
68
69 Bug Fixes
70 ---------
71
72 - Omit custom environ variables when rendering a custom exception template in
73   ``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``;
74   stringifying thse may trigger code that should not be executed; see
75   https://github.com/Pylons/pyramid/issues/239
76
77 1.1b3 (2011-07-15)
78 ==================
79
80 Features
81 --------
82
83 - Fix corner case to ease semifunctional testing of views: create a new
84   rendererinfo to clear out old registry on a rescan.  See
85   https://github.com/Pylons/pyramid/pull/234.
86
87 - New API class: ``pyramid.static.static_view``.  This supersedes the
88   deprecated ``pyramid.view.static`` class.  ``pyramid.static.static_view``
89   by default serves up documents as the result of the request's
90   ``path_info``, attribute rather than it's ``subpath`` attribute (the
91   inverse was true of ``pyramid.view.static``, and still is).
92   ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when
93   you want the static view to behave like the older deprecated version.
94
95 - A new API function ``pyramid.paster.bootstrap`` has been added to make
96   writing scripts that bootstrap a Pyramid environment easier, e.g.::
97
98       from pyramid.paster import bootstrap
99       info = bootstrap('/path/to/my/development.ini')
100       request = info['request']
101       print request.route_url('myroute')
102
103 - A new API function ``pyramid.scripting.prepare`` has been added.  It is a
104   lower-level analogue of ``pyramid.paster.boostrap`` that accepts a request
105   and a registry instead of a config file argument, and is used for the same
106   purpose::
107
108       from pyramid.scripting import prepare
109       info = prepare(registry=myregistry)
110       request = info['request']
111       print request.route_url('myroute')
112
113 - A new API function ``pyramid.scripting.make_request`` has been added.  The
114   resulting request will have a ``registry`` attribute.  It is meant to be
115   used in conjunction with ``pyramid.scripting.prepare`` and/or
116   ``pyramid.paster.bootstrap`` (both of which accept a request as an
117   argument)::
118
119       from pyramid.scripting import make_request
120       request = make_request('/')
121
122 - New API attribute ``pyramid.config.global_registries`` is an iterable
123   object that contains references to every Pyramid registry loaded into the
124   current process via ``pyramid.config.Configurator.make_app``.  It also has
125   a ``last`` attribute containing the last registry loaded.  This is used by
126   the scripting machinery, and is available for introspection.
127
128 Deprecations
129 ------------
130
131 - The ``pyramid.view.static`` class has been deprecated in favor of the newer
132   ``pyramid.static.static_view`` class.  A deprecation warning is raised when
133   it is used.  You should replace it with a reference to
134   ``pyramid.static.static_view`` with the ``use_subpath=True`` argument.
135
136 Bug Fixes
137 ---------
138
139 - Without a mo-file loaded for the combination of domain/locale,
140   ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale
141   combination raised an inscrutable "translations object has no attr
142   'plural'" error.  Now, instead it "works" (it uses a germanic pluralization
143   by default).  It's nonsensical to try to pluralize something without
144   translations for that locale/domain available, but this behavior matches
145   the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least
146   consistent; see https://github.com/Pylons/pyramid/issues/235.
147
148 1.1b2 (2011-07-13)
149 ==================
150
151 Features
152 --------
153
154 - New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new
155   configuration file value ``prevent_http_cache``.  These are synomymous and
156   allow you to prevent HTTP cache headers from being set by Pyramid's
157   ``http_cache`` machinery globally in a process.  see the "Influencing HTTP
158   Caching" section of the "View Configuration" narrative chapter and the
159   detailed documentation for this setting in the "Environment Variables and
160   Configuration Settings" narrative chapter.
161
162 Behavior Changes
163 ----------------
164
165 - Previously, If a ``BeforeRender`` event subscriber added a value via the
166   ``__setitem__`` or ``update`` methods of the event object with a key that
167   already existed in the renderer globals dictionary, a ``KeyError`` was
168   raised.  With the deprecation of the "add_renderer_globals" feature of the
169   configurator, there was no way to override an existing value in the
170   renderer globals dictionary that already existed.  Now, the event object
171   will overwrite an older value that is already in the globals dictionary
172   when its ``__setitem__`` or ``update`` is called (as well as the new
173   ``setdefault`` method), just like a plain old dictionary.  As a result, for
174   maximum interoperability with other third-party subscribers, if you write
175   an event subscriber meant to be used as a BeforeRender subscriber, your
176   subscriber code will now need to (using ``.get`` or ``__contains__`` of the
177   event object) ensure no value already exists in the renderer globals
178   dictionary before setting an overriding value.
179
180 Bug Fixes
181 ---------
182
183 - The ``Configurator.add_route`` method allowed two routes with the same
184   route to be added without an intermediate ``config.commit()``.  If you now
185   receive a ``ConfigurationError`` at startup time that appears to be
186   ``add_route`` related, you'll need to either a) ensure that all of your
187   route names are unique or b) call ``config.commit()`` before adding a
188   second route with the name of a previously added name or c) use a
189   Configurator that works in ``autocommit`` mode.
190
191 - The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds
192   inappropriately used ``DBSession.rollback()`` instead of
193   ``transaction.abort()`` in one place.
194
195 - We now clear ``request.response`` before we invoke an exception view; an
196   exception view will be working with a request.response that has not been
197   touched by any code prior to the exception.
198
199 - Views associated with routes with spaces in the route name may not have
200   been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4
201   and better.  See https://github.com/Pylons/pyramid/issues/232.
202
203 Documentation
204 -------------
205
206 - Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't
207   match the ``pyramid_routesalchemy`` scaffold function of the same name; it
208   didn't get synchronized when it was changed in the scaffold.
209
210 - New documentation section in View Configuration narrative chapter:
211   "Influencing HTTP Caching".
212
213 1.1b1 (2011-07-10)
214 ==================
215
216 Features
217 --------
218
219 - It is now possible to invoke ``paster pshell`` even if the paste ini file
220   section name pointed to in its argument is not actually a Pyramid WSGI
221   application.  The shell will work in a degraded mode, and will warn the
222   user.  See "The Interactive Shell" in the "Creating a Pyramid Project"
223   narrative documentation section.
224
225 - ``paster pshell`` now offers more built-in global variables by default
226   (including ``app`` and ``settings``).  See "The Interactive Shell" in the
227   "Creating a Pyramid Project" narrative documentation section.
228
229 - It is now possible to add a ``[pshell]`` section to your application's .ini
230   configuration file, which influences the global names available to a pshell
231   session.  See "Extending the Shell" in the "Creating a Pyramid Project"
232   narrative documentation chapter.
233
234 - The ``config.scan`` method has grown a ``**kw`` argument.  ``kw`` argument
235   represents a set of keyword arguments to pass to the Venusian ``Scanner``
236   object created by Pyramid.  (See the Venusian documentation for more
237   information about ``Scanner``).
238
239 - New request property: ``json_body``. This property will return the
240   JSON-decoded variant of the request body.  If the request body is not
241   well-formed JSON, this property will raise an exception.
242
243 - A new value ``http_cache`` can be used as a view configuration
244   parameter.
245
246   When you supply an ``http_cache`` value to a view configuration, the
247   ``Expires`` and ``Cache-Control`` headers of a response generated by the
248   associated view callable are modified.  The value for ``http_cache`` may be
249   one of the following:
250
251   - A nonzero integer.  If it's a nonzero integer, it's treated as a number
252     of seconds.  This number of seconds will be used to compute the
253     ``Expires`` header and the ``Cache-Control: max-age`` parameter of
254     responses to requests which call this view.  For example:
255     ``http_cache=3600`` instructs the requesting browser to 'cache this
256     response for an hour, please'.
257
258   - A ``datetime.timedelta`` instance.  If it's a ``datetime.timedelta``
259     instance, it will be converted into a number of seconds, and that number
260     of seconds will be used to compute the ``Expires`` header and the
261     ``Cache-Control: max-age`` parameter of responses to requests which call
262     this view.  For example: ``http_cache=datetime.timedelta(days=1)``
263     instructs the requesting browser to 'cache this response for a day,
264     please'.
265
266   - Zero (``0``).  If the value is zero, the ``Cache-Control`` and
267     ``Expires`` headers present in all responses from this view will be
268     composed such that client browser cache (and any intermediate caches) are
269     instructed to never cache the response.
270
271   - A two-tuple.  If it's a two tuple (e.g. ``http_cache=(1,
272     {'public':True})``), the first value in the tuple may be a nonzero
273     integer or a ``datetime.timedelta`` instance; in either case this value
274     will be used as the number of seconds to cache the response.  The second
275     value in the tuple must be a dictionary.  The values present in the
276     dictionary will be used as input to the ``Cache-Control`` response
277     header.  For example: ``http_cache=(3600, {'public':True})`` means 'cache
278     for an hour, and add ``public`` to the Cache-Control header of the
279     response'.  All keys and values supported by the
280     ``webob.cachecontrol.CacheControl`` interface may be added to the
281     dictionary.  Supplying ``{'public':True}`` is equivalent to calling
282     ``response.cache_control.public = True``.
283
284   Providing a non-tuple value as ``http_cache`` is equivalent to calling
285   ``response.cache_expires(value)`` within your view's body.
286
287   Providing a two-tuple value as ``http_cache`` is equivalent to calling
288   ``response.cache_expires(value[0], **value[1])`` within your view's body.
289
290   If you wish to avoid influencing, the ``Expires`` header, and instead wish
291   to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache``
292   with the first element of ``None``, e.g.: ``(None, {'public':True})``.
293
294 Bug Fixes
295 ---------
296
297 - Framework wrappers of the original view (such as http_cached and so on)
298   relied on being able to trust that the response they were receiving was an
299   IResponse.  It wasn't always, because the response was resolved by the
300   router instead of early in the view wrapping process.  This has been fixed.
301
302 Documentation
303 -------------
304
305 - Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded
306   Request Body" (usage of ``request.json_body``).
307
308 Behavior Changes
309 ----------------
310
311 - The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands
312   now take a single argument in the form ``/path/to/config.ini#sectionname``
313   rather than the previous 2-argument spelling ``/path/to/config.ini
314   sectionname``.  ``#sectionname`` may be omitted, in which case ``#main`` is
315   assumed.
316
317 1.1a4 (2011-07-01)
318 ==================
319
320 Bug Fixes
321 ---------
322
323 - ``pyramid.testing.DummyRequest`` now raises deprecation warnings when
324   attributes deprecated for ``pyramid.request.Request`` are accessed (like
325   ``response_content_type``).  This is for the benefit of folks running unit
326   tests which use DummyRequest instead of a "real" request, so they know
327   things are deprecated without necessarily needing a functional test suite.
328
329 - The ``pyramid.events.subscriber`` directive behaved contrary to the
330   documentation when passed more than one interface object to its
331   constructor.  For example, when the following listener was registered::
332
333      @subscriber(IFoo, IBar)
334      def expects_ifoo_events_and_ibar_events(event):
335          print event
336
337   The Events chapter docs claimed that the listener would be registered and
338   listening for both ``IFoo`` and ``IBar`` events.  Instead, it registered an
339   "object event" subscriber which would only be called if an IObjectEvent was
340   emitted where the object interface was ``IFoo`` and the event interface was
341   ``IBar``.
342
343   The behavior now matches the documentation. If you were relying on the
344   buggy behavior of the 1.0 ``subscriber`` directive in order to register an
345   object event subscriber, you must now pass a sequence to indicate you'd
346   like to register a subscriber for an object event. e.g.::
347
348      @subscriber([IFoo, IBar])
349      def expects_object_event(object, event):
350          print object, event
351
352 Features
353 --------
354
355 - Add JSONP renderer (see "JSONP renderer" in the Renderers chapter of the
356   documentation).
357
358 Deprecations
359 ------------
360
361 - Deprecated the ``set_renderer_globals_factory`` method of the Configurator
362   and the ``renderer_globals`` Configurator constructor parameter.
363
364 Documentation
365 -------------
366
367 - The Wiki and Wiki2 tutorial "Tests" chapters each had two bugs: neither did
368   told the user to depend on WebTest, and 2 tests failed in each as the
369   result of changes to Pyramid itself.  These issues have been fixed.
370
371 - Move 1.0.X CHANGES.txt entries to HISTORY.txt.
372
373 1.1a3 (2011-06-26)
374 ==================
375
376 Features
377 --------
378
379 - Added ``mako.preprocessor`` config file parameter; allows for a Mako
380   preprocessor to be specified as a Python callable or Python dotted name.
381   See https://github.com/Pylons/pyramid/pull/183 for rationale.
382
383 Bug fixes
384 ---------
385
386 - Pyramid would raise an AttributeError in the Configurator when attempting
387   to set a ``__text__`` attribute on a custom predicate that was actually a
388   classmethod.  See https://github.com/Pylons/pyramid/pull/217 .
389
390 - Accessing or setting deprecated response_* attrs on request
391   (e.g. ``response_content_type``) now issues a deprecation warning at access
392   time rather than at rendering time.
393
394 1.1a2 (2011-06-22)
395 ==================
396
397 Bug Fixes
398 ---------
399
400 - 1.1a1 broke Akhet by not providing a backwards compatibility import shim
401   for ``pyramid.paster.PyramidTemplate``.  Now one has been added, although a
402   deprecation warning is emitted when Akhet imports it.
403
404 - If multiple specs were provided in a single call to
405   ``config.add_translation_dirs``, the directories were inserted into the
406   beginning of the directory list in the wrong order: they were inserted in
407   the reverse of the order they were provided in the ``*specs`` list (items
408   later in the list were added before ones earlier in the list).  This is now
409   fixed.
410
411 Backwards Incompatibilities
412 ---------------------------
413
414 - The pyramid Router attempted to set a value into the key
415   ``environ['repoze.bfg.message']`` when it caught a view-related exception
416   for backwards compatibility with applications written for ``repoze.bfg``
417   during error handling.  It did this by using code that looked like so::
418
419                     # "why" is an exception object
420                     try: 
421                         msg = why[0]
422                     except:
423                         msg = ''
424
425                     environ['repoze.bfg.message'] = msg
426
427   Use of the value ``environ['repoze.bfg.message']`` was docs-deprecated in
428   Pyramid 1.0.  Our standing policy is to not remove features after a
429   deprecation for two full major releases, so this code was originally slated
430   to be removed in Pyramid 1.2.  However, computing the
431   ``repoze.bfg.message`` value was the source of at least one bug found in
432   the wild (https://github.com/Pylons/pyramid/issues/199), and there isn't a
433   foolproof way to both preserve backwards compatibility and to fix the bug.
434   Therefore, the code which sets the value has been removed in this release.
435   Code in exception views which relies on this value's presence in the
436   environment should now use the ``exception`` attribute of the request
437   (e.g. ``request.exception[0]``) to retrieve the message instead of relying
438   on ``request.environ['repoze.bfg.message']``.
439
440 1.1a1 (2011-06-20)
441 ==================
442
443 Documentation
444 -------------
445
446 - The term "template" used to refer to both "paster templates" and "rendered
447   templates" (templates created by a rendering engine.  i.e. Mako, Chameleon,
448   Jinja, etc.).  "Paster templates" will now be refered to as "scaffolds",
449   whereas the name for "rendered templates" will remain as "templates."
450
451 - The ``wiki`` (ZODB+Traversal) tutorial was updated slightly.
452
453 - The ``wiki2`` (SQLA+URL Dispatch) tutorial was updated slightly.
454
455 - Make ``pyramid.interfaces.IAuthenticationPolicy`` and
456   ``pyramid.interfaces.IAuthorizationPolicy`` public interfaces, and refer to
457   them within the ``pyramid.authentication`` and ``pyramid.authorization``
458   API docs.
459
460 - Render the function definitions for each exposed interface in
461   ``pyramid.interfaces``.
462
463 - Add missing docs reference to
464   ``pyramid.config.Configurator.set_view_mapper`` and refer to it within
465   Hooks chapter section named "Using a View Mapper".
466
467 - Added section to the "Environment Variables and ``.ini`` File Settings"
468   chapter in the narrative documentation section entitled "Adding a Custom
469   Setting".
470
471 - Added documentation for a "multidict" (e.g. the API of ``request.POST``) as
472   interface API documentation.
473
474 - Added a section to the "URL Dispatch" narrative chapter regarding the new
475   "static" route feature.
476
477 - Added "What's New in Pyramid 1.1" to HTML rendering of documentation.
478
479 - Added API docs for ``pyramid.authentication.SessionAuthenticationPolicy``.
480
481 - Added API docs for ``pyramid.httpexceptions.exception_response``.
482
483 - Added "HTTP Exceptions" section to Views narrative chapter including a
484   description of ``pyramid.httpexceptions.exception_response``.
485
486 Features
487 --------
488
489 - Add support for language fallbacks: when trying to translate for a
490   specific territory (such as ``en_GB``) fall back to translations
491   for the language (ie ``en``). This brings the translation behaviour in line
492   with GNU gettext and fixes partially translated texts when using C
493   extensions.
494
495 - New authentication policy:
496   ``pyramid.authentication.SessionAuthenticationPolicy``, which uses a session
497   to store credentials.
498
499 - Accessing the ``response`` attribute of a ``pyramid.request.Request``
500   object (e.g. ``request.response`` within a view) now produces a new
501   ``pyramid.response.Response`` object.  This feature is meant to be used
502   mainly when a view configured with a renderer needs to set response
503   attributes: all renderers will use the Response object implied by
504   ``request.response`` as the response object returned to the router.
505
506   ``request.response`` can also be used by code in a view that does not use a
507   renderer, however the response object that is produced by
508   ``request.response`` must be returned when a renderer is not in play (it is
509   not a "global" response).
510
511 - Integers and longs passed as ``elements`` to ``pyramid.url.resource_url``
512   or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context,
513   request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be
514   converted implicitly to strings in the result.  Previously passing integers
515   or longs as elements would cause a TypeError.
516
517 - ``pyramid_alchemy`` paster template now uses ``query.get`` rather than
518   ``query.filter_by`` to take better advantage of identity map caching.
519
520 - ``pyramid_alchemy`` paster template now has unit tests.
521
522 - Added ``pyramid.i18n.make_localizer`` API (broken out from
523   ``get_localizer`` guts).
524
525 - An exception raised by a NewRequest event subscriber can now be caught by
526   an exception view.
527
528 - It is now possible to get information about why Pyramid raised a Forbidden
529   exception from within an exception view.  The ``ACLDenied`` object returned
530   by the ``permits`` method of each stock authorization policy
531   (``pyramid.interfaces.IAuthorizationPolicy.permits``) is now attached to
532   the Forbidden exception as its ``result`` attribute.  Therefore, if you've
533   created a Forbidden exception view, you can see the ACE, ACL, permission,
534   and principals involved in the request as
535   eg. ``context.result.permission``, ``context.result.acl``, etc within the
536   logic of the Forbidden exception view.
537
538 - Don't explicitly prevent the ``timeout`` from being lower than the
539   ``reissue_time`` when setting up an ``AuthTktAuthenticationPolicy``
540   (previously such a configuration would raise a ``ValueError``, now it's
541   allowed, although typically nonsensical).  Allowing the nonsensical
542   configuration made the code more understandable and required fewer tests.
543
544 - A new paster command named ``paster pviews`` was added.  This command
545   prints a summary of potentially matching views for a given path.  See the
546   section entitled "Displaying Matching Views for a Given URL" in the "View
547   Configuration" chapter of the narrative documentation for more information.
548
549 - The ``add_route`` method of the Configurator now accepts a ``static``
550   argument.  If this argument is ``True``, the added route will never be
551   considered for matching when a request is handled.  Instead, it will only
552   be useful for URL generation via ``route_url`` and ``route_path``.  See the
553   section entitled "Static Routes" in the URL Dispatch narrative chapter for
554   more information.
555
556 - A default exception view for the context
557   ``pyramid.interfaces.IExceptionResponse`` is now registered by default.
558   This means that an instance of any exception response class imported from
559   ``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from
560   within view code; when raised, this exception view will render the
561   exception to a response.
562
563 - A function named ``pyramid.httpexceptions.exception_response`` is a
564   shortcut that can be used to create HTTP exception response objects using
565   an HTTP integer status code.
566
567 - The Configurator now accepts an additional keyword argument named
568   ``exceptionresponse_view``.  By default, this argument is populated with a
569   default exception view function that will be used when a response is raised
570   as an exception. When ``None`` is passed for this value, an exception view
571   for responses will not be registered.  Passing ``None`` returns the
572   behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception
573   will propagate to middleware and to the WSGI server).
574
575 - The ``pyramid.request.Request`` class now has a ``ResponseClass`` interface
576   which points at ``pyramid.response.Response``.
577
578 - The ``pyramid.response.Response`` class now has a ``RequestClass``
579   interface which points at ``pyramid.request.Request``.
580
581 - It is now possible to return an arbitrary object from a Pyramid view
582   callable even if a renderer is not used, as long as a suitable adapter to
583   ``pyramid.interfaces.IResponse`` is registered for the type of the returned
584   object by using the new
585   ``pyramid.config.Configurator.add_response_adapter`` API.  See the section
586   in the Hooks chapter of the documentation entitled "Changing How Pyramid
587   Treats View Responses".
588
589 - The Pyramid router will now, by default, call the ``__call__`` method of
590   WebOb response objects when returning a WSGI response.  This means that,
591   among other things, the ``conditional_response`` feature of WebOb response
592   objects will now behave properly.
593
594 - New method named ``pyramid.request.Request.is_response``.  This method
595   should be used instead of the ``pyramid.view.is_response`` function, which
596   has been deprecated.
597
598 Bug Fixes
599 ---------
600
601 - URL pattern markers used in URL dispatch are permitted to specify a custom
602   regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345``
603   (foo==12345 in the match dictionary) but not ``/abc``. However, custom
604   regexes in a pattern marker which used squiggly brackets did not work. For
605   example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and
606   ``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of
607   inner squiggly brackets is now recognized so that the prior two patterns
608   given as examples now work. See also
609   https://github.com/Pylons/pyramid/issues/#issue/123.
610
611 - Don't send port numbers along with domain information in cookies set by
612   AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131).
613
614 - ``pyramid.url.route_path`` (and the shortcut
615   ``pyramid.request.Request.route_url`` method) now include the WSGI
616   SCRIPT_NAME at the front of the path if it is not empty (see
617   https://github.com/Pylons/pyramid/issues/135).
618
619 - ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the
620   empty string).
621
622 - Don't quote ``:@&+$,`` symbols in ``*elements`` passed to
623   ``pyramid.url.route_url`` or ``pyramid.url.resource_url`` (see
624   https://github.com/Pylons/pyramid/issues#issue/141).
625
626 - Include SCRIPT_NAME in redirects issued by
627   ``pyramid.view.append_slash_notfound_view`` (see
628   https://github.com/Pylons/pyramid/issues#issue/149).
629
630 - Static views registered with ``config.add_static_view`` which also included
631   a ``permission`` keyword argument would not work as expected, because
632   ``add_static_view`` also registered a route factory internally.  Because a
633   route factory was registered internally, the context checked by the Pyramid
634   permission machinery never had an ACL.  ``add_static_view`` no longer
635   registers a route with a factory, so the default root factory will be used.
636
637 - ``config.add_static_view`` now passes extra keyword arguments it receives
638   to ``config.add_route`` (calling add_static_view is mostly logically
639   equivalent to adding a view of the type ``pyramid.static.static_view``
640   hooked up to a route with a subpath).  This makes it possible to pass e.g.,
641   ``factory=`` to ``add_static_view`` to protect a particular static view
642   with a custom ACL.
643
644 - ``testing.DummyRequest`` used the wrong registry (the global registry) as
645   ``self.registry`` if a dummy request was created *before* ``testing.setUp``
646   was executed (``testing.setUp`` pushes a local registry onto the
647   threadlocal stack). Fixed by implementing ``registry`` as a property for
648   DummyRequest instead of eagerly assigning an attribute.
649   See also https://github.com/Pylons/pyramid/issues/165
650
651 - When visiting a URL that represented a static view which resolved to a
652   subdirectory, the ``index.html`` of that subdirectory would not be served
653   properly.  Instead, a redirect to ``/subdir`` would be issued.  This has
654   been fixed, and now visiting a subdirectory that contains an ``index.html``
655   within a static view returns the index.html properly.  See also
656   https://github.com/Pylons/pyramid/issues/67.
657
658 - Redirects issued by a static view did not take into account any existing
659   ``SCRIPT_NAME`` (such as one set by a url mapping composite).  Now they do.
660
661 - The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the
662   ``SCRIPT_NAME`` in the origin request.
663
664 - The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it
665   decorated a view found via traversal; it ignored the ``PATH_INFO`` that was
666   part of a url-dispatch-matched view.
667
668 Deprecations
669 ------------
670
671 - Deprecated all assignments to ``request.response_*`` attributes (for
672   example ``request.response_content_type = 'foo'`` is now deprecated).
673   Assignments and mutations of assignable request attributes that were
674   considered by the framework for response influence are now deprecated:
675   ``response_content_type``, ``response_headerlist``, ``response_status``,
676   ``response_charset``, and ``response_cache_for``.  Instead of assigning
677   these to the request object for later detection by the rendering machinery,
678   users should use the appropriate API of the Response object created by
679   accessing ``request.response`` (e.g. code which does
680   ``request.response_content_type = 'abc'`` should be changed to
681   ``request.response.content_type = 'abc'``).
682
683 - Passing view-related parameters to
684   ``pyramid.config.Configurator.add_route`` is now deprecated.  Previously, a
685   view was permitted to be connected to a route using a set of ``view*``
686   parameters passed to the ``add_route`` method of the Configurator.  This
687   was a shorthand which replaced the need to perform a subsequent call to
688   ``add_view``. For example, it was valid (and often recommended) to do::
689
690      config.add_route('home', '/', view='mypackage.views.myview',
691                        view_renderer='some/renderer.pt')
692
693   Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of
694   connecting a view to a predefined route via ``Configurator.add_view`` using
695   the route's ``route_name`` parameter.  As a result, the above example
696   should now be spelled::
697
698      config.add_route('home', '/')
699      config.add_view('mypackage.views.myview', route_name='home')
700                      renderer='some/renderer.pt')
701
702   This deprecation was done to reduce confusion observed in IRC, as well as
703   to (eventually) reduce documentation burden (see also
704   https://github.com/Pylons/pyramid/issues/164).  A deprecation warning is
705   now issued when any view-related parameter is passed to
706   ``Configurator.add_route``.
707
708 - Passing an ``environ`` dictionary to the ``__call__`` method of a
709   "traverser" (e.g. an object that implements
710   ``pyramid.interfaces.ITraverser`` such as an instance of
711   ``pyramid.traversal.ResourceTreeTraverser``) as its ``request`` argument
712   now causes a deprecation warning to be emitted.  Consumer code should pass a
713   ``request`` object instead.  The fact that passing an environ dict is
714   permitted has been documentation-deprecated since ``repoze.bfg`` 1.1, and
715   this capability will be removed entirely in a future version.
716
717 - The following (undocumented, dictionary-like) methods of the
718   ``pyramid.request.Request`` object have been deprecated: ``__contains__``,
719   ``__delitem__``, ``__getitem__``, ``__iter__``, ``__setitem__``, ``get``,
720   ``has_key``, ``items``, ``iteritems``, ``itervalues``, ``keys``, ``pop``,
721   ``popitem``, ``setdefault``, ``update``, and ``values``.  Usage of any of
722   these methods will cause a deprecation warning to be emitted.  These
723   methods were added for internal compatibility in ``repoze.bfg`` 1.1 (code
724   that currently expects a request object expected an environ object in BFG
725   1.0 and before).  In a future version, these methods will be removed
726   entirely.
727
728 - Deprecated ``pyramid.view.is_response`` function in favor of (newly-added)
729   ``pyramid.request.Request.is_response`` method.  Determining if an object
730   is truly a valid response object now requires access to the registry, which
731   is only easily available as a request attribute.  The
732   ``pyramid.view.is_response`` function will still work until it is removed,
733   but now may return an incorrect answer under some (very uncommon)
734   circumstances.
735
736 Behavior Changes
737 ----------------
738
739 - The default Mako renderer is now configured to escape all HTML in
740   expression tags. This is intended to help prevent XSS attacks caused by
741   rendering unsanitized input from users. To revert this behavior in user's
742   templates, they need to filter the expression through the 'n' filter.
743   For example, ${ myhtml | n }.
744   See https://github.com/Pylons/pyramid/issues/193.
745
746 - A custom request factory is now required to return a request object that
747   has a ``response`` attribute (or "reified"/lazy property) if they the
748   request is meant to be used in a view that uses a renderer.  This
749   ``response`` attribute should be an instance of the class
750   ``pyramid.response.Response``.
751
752 - The JSON and string renderer factories now assign to
753   ``request.response.content_type`` rather than
754   ``request.response_content_type``.
755
756 - Each built-in renderer factory now determines whether it should change the
757   content type of the response by comparing the response's content type
758   against the response's default content type; if the content type is the
759   default content type (usually ``text/html``), the renderer changes the
760   content type (to ``application/json`` or ``text/plain`` for JSON and string
761   renderers respectively).
762
763 - The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of
764   figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the
765   downstream application.  As a result, those values may differ slightly from
766   the perspective of the downstream application (for example, ``SCRIPT_NAME``
767   will now never possess a trailing slash).
768
769 - Previously, ``pyramid.request.Request`` inherited from
770   ``webob.request.Request`` and implemented ``__getattr__``, ``__setattr__``
771   and ``__delattr__`` itself in order to overidde "adhoc attr" WebOb behavior
772   where attributes of the request are stored in the environ.  Now,
773   ``pyramid.request.Request`` object inherits from (the more recent)
774   ``webob.request.BaseRequest`` instead of ``webob.request.Request``, which
775   provides the same behavior.  ``pyramid.request.Request`` no longer
776   implements its own ``__getattr__``, ``__setattr__`` or ``__delattr__`` as a
777   result.
778
779 - ``pyramid.response.Response`` is now a *subclass* of
780   ``webob.response.Response`` (in order to directly implement the
781   ``pyramid.interfaces.IResponse`` interface).
782
783 - The "exception response" objects importable from ``pyramid.httpexceptions``
784   (e.g. ``HTTPNotFound``) are no longer just import aliases for classes that
785   actually live in ``webob.exc``.  Instead, we've defined our own exception
786   classes within the module that mirror and emulate the ``webob.exc``
787   exception response objects almost entirely.  See the "Design Defense" doc
788   section named "Pyramid Uses its Own HTTP Exception Classes" for more
789   information.
790
791 Backwards Incompatibilities
792 ---------------------------
793
794 - Pyramid no longer supports Python 2.4.  Python 2.5 or better is required to
795   run Pyramid 1.1+.
796
797 - The Pyramid router now, by default, expects response objects returned from
798   view callables to implement the ``pyramid.interfaces.IResponse`` interface.
799   Unlike the Pyramid 1.0 version of this interface, objects which implement
800   IResponse now must define a ``__call__`` method that accepts ``environ``
801   and ``start_response``, and which returns an ``app_iter`` iterable, among
802   other things.  Previously, it was possible to return any object which had
803   the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as
804   a response, so this is a backwards incompatibility.  It is possible to get
805   backwards compatibility back by registering an adapter to IResponse from
806   the type of object you're now returning from view callables.  See the
807   section in the Hooks chapter of the documentation entitled "Changing How
808   Pyramid Treats View Responses".
809
810 - The ``pyramid.interfaces.IResponse`` interface is now much more extensive.
811   Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now
812   it is basically intended to directly mirror the ``webob.Response`` API,
813   which has many methods and attributes.
814
815 - The ``pyramid.httpexceptions`` classes named ``HTTPFound``,
816   ``HTTPMultipleChoices``, ``HTTPMovedPermanently``, ``HTTPSeeOther``,
817   ``HTTPUseProxy``, and ``HTTPTemporaryRedirect`` now accept ``location`` as
818   their first positional argument rather than ``detail``.  This means that
819   you can do, e.g. ``return pyramid.httpexceptions.HTTPFound('http://foo')``
820   rather than ``return
821   pyramid.httpexceptions.HTTPFound(location='http//foo')`` (the latter will
822   of course continue to work).
823
824 Dependencies
825 ------------
826
827 - Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that
828   release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``".
829   (Note that in reality, everyone should probably be using 1.0.4 or better
830   though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.)
831
e21ed8 832 1.0 (2011-01-30)
CM 833 ================
834
835 Documentation
836 -------------
837
838 - Fixed bug in ZODB Wiki tutorial (missing dependency on ``docutils`` in
839   "models" step within ``setup.py``).
840
841 - Removed API documentation for ``pyramid.testing`` APIs named
842   ``registerDummySecurityPolicy``, ``registerResources``, ``registerModels``,
843   ``registerEventListener``, ``registerTemplateRenderer``,
844   ``registerDummyRenderer``, ``registerView``, ``registerUtility``,
845   ``registerAdapter``, ``registerSubscriber``, ``registerRoute``,
846   and ``registerSettings``.
847
848 - Moved "Using ZODB With ZEO" and "Using repoze.catalog Within Pyramid"
849   tutorials out of core documentation and into the Pyramid Tutorials site
850   (http://docs.pylonsproject.org/projects/pyramid_tutorials/dev/).
851
852 - Changed "Cleaning up After a Request" section in the URL Dispatch chapter
853   to use ``request.add_finished_callback`` instead of jamming an object with
854   a ``__del__`` into the WSGI environment.
855
856 - Remove duplication of ``add_route`` API documentation from URL Dispatch
857   narrative chapter.
858
859 - Remove duplication of API and narrative documentation in
860   ``pyramid.view.view_config`` API docs by pointing to
861   ``pyramid.config.add_view`` documentation and narrative chapter
862   documentation.
863
864 - Removed some API documentation duplicated in narrative portions of
865   documentation 
866
867 - Removed "Overall Flow of Authentication" from SQLAlchemy + URL Dispatch
868   wiki tutorial due to print space concerns (moved to Pyramid Tutorials
869   site).
870
871 Bug Fixes
872 ---------
873
874 - Deprecated-since-BFG-1.2 APIs from ``pyramid.testing`` now properly emit
875   deprecation warnings.
876
877 - Added ``egg:repoze.retry#retry`` middleware to the WSGI pipeline in ZODB
878   templates (retry ZODB conflict errors which occur in normal operations).
879
880 - Removed duplicate implementations of ``is_response``.  Two competing
881   implementations existed: one in ``pyramid.config`` and one in
882   ``pyramid.view``.  Now the one defined in ``pyramid.view`` is used
883   internally by ``pyramid.config`` and continues to be advertised as an API.
884
885 1.0b3 (2011-01-28)
886 ==================
887
888 Bug Fixes
889 ---------
890
891 - Use © instead of copyright symbol in paster templates / tutorial
892   templates for the benefit of folks who cutnpaste and save to a non-UTF8
893   format.
894
895 - ``pyramid.view.append_slash_notfound_view`` now preserves GET query
896   parameters across redirects.
897
898 Documentation
899 -------------
900
901 - Beef up documentation related to ``set_default_permission``: explicitly
902   mention that default permissions also protect exception views.
903
904 - Paster templates and tutorials now use spaces instead of tabs in their HTML
905   templates.
906
907 1.0b2 (2011-01-24)
908 ==================
909
910 Bug Fixes
911 ---------
912
913 - The ``production.ini`` generated by all paster templates now have an
914   effective logging level of WARN, which prevents e.g. SQLAlchemy statement
915   logging and other inappropriate output.
916
917 - The ``production.ini`` of the ``pyramid_routesalchemy`` and
918   ``pyramid_alchemy`` paster templates did not have a ``sqlalchemy`` logger
919   section, preventing ``paster serve production.ini`` from working.
920
921 - The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` paster templates used
922   the ``{{package}}`` variable in a place where it should have used the
923   ``{{project}}`` variable, causing applications created with uppercase
924   letters e.g. ``paster create -t pyramid_routesalchemy Dibbus`` to fail to
925   start when ``paster serve development.ini`` was used against the result.
926   See https://github.com/Pylons/pyramid/issues/#issue/107
927
928 - The ``render_view`` method of ``pyramid.renderers.RendererHelper`` passed
929   an incorrect value into the renderer for ``renderer_info``.  It now passes
930   an instance of ``RendererHelper`` instead of a dictionary, which is
931   consistent with other usages.  See
932   https://github.com/Pylons/pyramid/issues#issue/106
933
934 - A bug existed in the ``pyramid.authentication.AuthTktCookieHelper`` which
935   would break any usage of an AuthTktAuthenticationPolicy when one was
936   configured to reissue its tokens (``reissue_time`` < ``timeout`` /
937   ``max_age``). Symptom: ``ValueError: ('Invalid token %r', '')``.  See
938   https://github.com/Pylons/pyramid/issues#issue/108.
939
940 1.0b1 (2011-01-21)
941 ==================
942
943 Features
944 --------
945
946 - The AuthTktAuthenticationPolicy now accepts a ``tokens`` parameter via
947   ``pyramid.security.remember``.  The value must be a sequence of strings.
948   Tokens are placed into the auth_tkt "tokens" field and returned in the
949   auth_tkt cookie.
950
951 - Add ``wild_domain`` argument to AuthTktAuthenticationPolicy, which defaults
952   to ``True``.  If it is set to ``False``, the feature of the policy which
953   sets a cookie with a wilcard domain will be turned off.
954
955 - Add a ``MANIFEST.in`` file to each paster template. See
956   https://github.com/Pylons/pyramid/issues#issue/95
957
958 Bug Fixes
959 ---------
960
961 - ``testing.setUp`` now adds a ``settings`` attribute to the registry (both
962   when it's passed a registry without any settings and when it creates one).
963
964 - The ``testing.setUp`` function now takes a ``settings`` argument, which
965   should be a dictionary.  Its values will subsequently be available on the
966   returned ``config`` object as ``config.registry.settings``.
967
968 Documentation
969 -------------
970
971 - Added "What's New in Pyramid 1.0" chapter to HTML rendering of
972   documentation.
973
974 - Merged caseman-master narrative editing branch, many wording fixes and
975   extensions.
976
977 - Fix deprecated example showing ``chameleon_zpt`` API call in testing
978   narrative chapter.
979
980 - Added "Adding Methods to the Configurator via ``add_directive``" section to
981   Advanced Configuration narrative chapter.
982
983 - Add docs for ``add_finished_callback``, ``add_response_callback``,
984   ``route_path``, ``route_url``, and ``static_url`` methods to
985   ``pyramid.request.Request`` API docs.
986
987 - Add (minimal) documentation about using I18N within Mako templates to
988   "Internationalization and Localization" narrative chapter.
989
990 - Move content of "Forms" chapter back to "Views" chapter; I can't think of a
991   better place to put it.
992
993 - Slightly improved interface docs for ``IAuthorizationPolicy``.
994
995 - Minimally explain usage of custom regular expressions in URL dispatch
996   replacement markers within URL Dispatch chapter.
997
998 Deprecations
999 -------------
1000
1001 - Using the ``pyramid.view.bfg_view`` alias for ``pyramid.view.view_config``
1002   (a backwards compatibility shim) now issues a deprecation warning.
1003
1004 Backwards Incompatibilities
1005 ---------------------------
1006
1007 - Using ``testing.setUp`` now registers an ISettings utility as a side
1008   effect.  Some test code which queries for this utility after
1009   ``testing.setUp`` via queryAdapter will expect a return value of ``None``.
1010   This code will need to be changed.
1011
1012 - When a ``pyramid.exceptions.Forbidden`` error is raised, its status code
1013   now ``403 Forbidden``.  It was previously ``401 Unauthorized``, for
1014   backwards compatibility purposes with ``repoze.bfg``.  This change will
1015   cause problems for users of Pyramid with ``repoze.who``, which intercepts
1016   ``401 Unauthorized`` by default, but allows ``403 Forbidden`` to pass
1017   through.  Those deployments will need to configure ``repoze.who`` to also
1018   react to ``403 Forbidden``.
1019
1020 - The default value for the ``cookie_on_exception`` parameter to
1021   ``pyramid.session.UnencyrptedCookieSessionFactory`` is now ``True``.  This
1022   means that when view code causes an exception to be raised, and the session
1023   has been mutated, a cookie will be sent back in the response.  Previously
1024   its default value was ``False``.
1025
1026 Paster Templates
1027 ----------------
1028
1029 - The ``pyramid_zodb``, ``pyramid_routesalchemy`` and ``pyramid_alchemy``
1030   paster templates now use a default "commit veto" hook when configuring the
1031   ``repoze.tm2`` transaction manager in ``development.ini``.  This prevents a
1032   transaction from being committed when the response status code is within
1033   the 400 or 500 ranges.  See also
1034   http://docs.repoze.org/tm2/#using-a-commit-veto.
1035
1036 1.0a10 (2011-01-18)
1037 ===================
1038
1039 Bug Fixes
1040 ---------
1041
1042 - URL dispatch now properly handles a ``.*`` or ``*`` appearing in a regex
1043   match when used inside brackets.  Resolves issue #90.
1044
1045 Backwards Incompatibilities
1046 ---------------------------
1047
1048 - The ``add_handler`` method of a Configurator has been removed from the
1049   Pyramid core.  Handlers are now a feature of the ``pyramid_handlers``
1050   package, which can be downloaded from PyPI.  Documentation for the package
1051   should be available via
1052   http://pylonsproject.org/projects/pyramid_handlers/dev/, which describes how
1053   to add a configuration statement to your ``main`` block to reobtain this
1054   method.  You will also need to add an ``install_requires`` dependency upon
1055   ``pyramid_handlers`` to your ``setup.py`` file.
1056
1057 - The ``load_zcml`` method of a Configurator has been removed from the
1058   Pyramid core.  Loading ZCML is now a feature of the ``pyramid_zcml``
1059   package, which can be downloaded from PyPI.  Documentation for the package
1060   should be available via
1061   http://pylonsproject.org/projects/pyramid_zcml/dev/, which describes how
1062   to add a configuration statement to your ``main`` block to reobtain this
1063   method.  You will also need to add an ``install_requires`` dependency upon
1064   ``pyramid_zcml`` to your ``setup.py`` file.
1065
1066 - The ``pyramid.includes`` subpackage has been removed.  ZCML files which use
1067   include the package ``pyramid.includes`` (e.g. ``<include
1068   package="pyramid.includes"/>``) now must include the ``pyramid_zcml``
1069   package instead (e.g. ``<include package="pyramid_zcml"/>``).
1070
1071 - The ``pyramid.view.action`` decorator has been removed from the Pyramid
1072   core.  Handlers are now a feature of the ``pyramid_handlers`` package.  It
1073   should now be imported from ``pyramid_handlers`` e.g. ``from
1074   pyramid_handlers import action``.
1075
1076 - The ``handler`` ZCML directive has been removed.  It is now a feature of
1077   the ``pyramid_handlers`` package.
1078
1079 - The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` paster
1080   templates were removed.  Use ``pyramid_sqla`` (available from PyPI) as a
1081   generic replacement for Pylons-esque development.
1082
1083 - The ``make_app`` function has been removed from the ``pyramid.router``
1084   module.  It continues life within the ``pyramid_zcml`` package.  This
1085   leaves the ``pyramid.router`` module without any API functions.
1086
1087 - The ``configure_zcml`` setting within the deployment settings (within
1088   ``**settings`` passed to a Pyramid ``main`` function) has ceased to have any
1089   meaning.
1090
1091 Features
1092 --------
1093
1094 - ``pyramid.testing.setUp`` and ``pyramid.testing.tearDown`` have been
1095   undeprecated.  They are now the canonical setup and teardown APIs for test
1096   configuration, replacing "direct" creation of a Configurator.  This is a
1097   change designed to provide a facade that will protect against any future
1098   Configurator deprecations.
1099
1100 - Add ``charset`` attribute to ``pyramid.testing.DummyRequest``
1101   (unconditionally ``UTF-8``).
1102
1103 - Add ``add_directive`` method to configurator, which allows framework
1104   extenders to add methods to the configurator (ala ZCML directives).
1105
1106 - When ``Configurator.include`` is passed a *module* as an argument, it
1107   defaults to attempting to find and use a callable named ``includeme``
1108   within that module.  This makes it possible to use
1109   ``config.include('some.module')`` rather than
1110   ``config.include('some.module.somefunc')`` as long as the include function
1111   within ``some.module`` is named ``includeme``.
1112
1113 - The ``bfg2pyramid`` script now converts ZCML include tags that have
1114   ``repoze.bfg.includes`` as a package attribute to the value
1115   ``pyramid_zcml``.  For example, ``<include package="repoze.bfg.includes">``
1116   will be converted to ``<include package="pyramid_zcml">``.
1117
1118 Paster Templates
1119 ----------------
1120
1121 - All paster templates now use ``pyramid.testing.setUp`` and
1122   ``pyramid.testing.tearDown`` rather than creating a Configurator "by hand"
1123   within their ``tests.py`` module, as per decision in features above.
1124
1125 - The ``starter_zcml`` paster template has been moved to the ``pyramid_zcml``
1126   package.
1127
1128 Documentation
1129 -------------
1130
1131 - The wiki and wiki2 tutorials now use ``pyramid.testing.setUp`` and
1132   ``pyramid.testing.tearDown`` rather than creating a Configurator "by hand",
1133   as per decision in features above.
1134
1135 - The "Testing" narrative chapter now explains ``pyramid.testing.setUp`` and
1136   ``pyramid.testing.tearDown`` instead of Configurator creation and
1137   ``Configurator.begin()`` and ``Configurator.end()``.
1138
1139 - Document the ``request.override_renderer`` attribute within the narrative
1140   "Renderers" chapter in a section named "Overriding A Renderer at Runtime".
1141
1142 - The "Declarative Configuration" narrative chapter has been removed (it was
1143   moved to the ``pyramid_zcml`` package).
1144
1145 - Most references to ZCML in narrative chapters have been removed or
1146   redirected to ``pyramid_zcml`` locations.
1147
1148 Deprecations
1149 ------------
1150
1151 - Deprecation warnings related to import of the following API functions were
1152   added: ``pyramid.traversal.find_model``, ``pyramid.traversal.model_path``,
1153   ``pyramid.traversal.model_path_tuple``, ``pyramid.url.model_url``.  The
1154   instructions emitted by the deprecation warnings instruct the developer to
1155   change these method spellings to their ``resource`` equivalents.  This is a
1156   consequence of the mass concept rename of "model" to "resource" performed
1157   in 1.0a7.
1158
1159 1.0a9 (2011-01-08)
1160 ==================
1161
1162 Bug Fixes
1163 ---------
1164
1165 - The ``proutes`` command tried too hard to resolve the view for printing,
1166   resulting in exceptions when an exceptional root factory was encountered.
1167   Instead of trying to resolve the view, if it cannot, it will now just print
1168   ``<unknown>``.
1169
1170 - The `self` argument was included in new methods of the ``ISession`` interface
1171   signature, causing ``pyramid_beaker`` tests to fail.
1172
1173 - Readd ``pyramid.traversal.model_path_tuple`` as an alias for
1174   ``pyramid.traversal.resource_path_tuple`` for backwards compatibility.
1175
1176 Features
1177 --------
1178
1179 - Add a new API ``pyramid.url.current_route_url``, which computes a URL based
1180   on the "current" route (if any) and its matchdict values.
1181
1182 - ``config.add_view`` now accepts a ``decorator`` keyword argument, a callable
1183   which will decorate the view callable before it is added to the registry.
1184
1185 - If a handler class provides an ``__action_decorator__`` attribute (usually
1186   a classmethod or staticmethod), use that as the decorator for each view
1187   registration for that handler.
1188
1189 - The ``pyramid.interfaces.IAuthenticationPolicy`` interface now specifies an
1190   ``unauthenticated_userid`` method.  This method supports an important
1191   optimization required by people who are using persistent storages which do
1192   not support object caching and whom want to create a "user object" as a
1193   request attribute.
1194
1195 - A new API has been added to the ``pyramid.security`` module named
1196   ``unauthenticated_userid``.  This API function calls the
1197   ``unauthenticated_userid`` method of the effective security policy.
1198
1199 - An ``unauthenticated_userid`` method has been added to the dummy
1200   authentication policy returned by
1201   ``pyramid.config.Configurator.testing_securitypolicy``.  It returns the
1202   same thing as that the dummy authentication policy's
1203   ``authenticated_userid`` method.
1204
1205 - The class ``pyramid.authentication.AuthTktCookieHelper`` is now an API.
1206   This class can be used by third-party authentication policy developers to
1207   help in the mechanics of authentication cookie-setting.
1208
1209 - New constructor argument to Configurator: ``default_view_mapper``.  Useful
1210   to create systems that have alternate view calling conventions.  A view
1211   mapper allows objects that are meant to be used as view callables to have
1212   an arbitrary argument list and an arbitrary result.  The object passed as
1213   ``default_view_mapper`` should implement the
1214   ``pyramid.interfaces.IViewMapperFactory`` interface.
1215
1216 - add a ``set_view_mapper`` API to Configurator.  Has
1217   the same result as passing ``default_view_mapper`` to the Configurator
1218   constructor.
1219
1220 - ``config.add_view`` now accepts a ``mapper`` keyword argument, which should
1221   either be ``None``, a string representing a Python dotted name, or an
1222   object which is an ``IViewMapperFactory``.  This feature is not useful for
1223   "civilians", only for extension writers.
1224
1225 - Allow static renderer provided during view registration to be overridden at
1226   request time via a request attribute named ``override_renderer``, which
1227   should be the name of a previously registered renderer.  Useful to provide
1228   "omnipresent" RPC using existing rendered views.
1229
1230 - Instances of ``pyramid.testing.DummyRequest`` now have a ``session``
1231   object, which is mostly a dictionary, but also implements the other session
1232   API methods for flash and CSRF.
1233
1234 Backwards Incompatibilities
1235 ---------------------------
1236
1237 - Since the ``pyramid.interfaces.IAuthenticationPolicy`` interface now
1238   specifies that a policy implementation must implement an
1239   ``unauthenticated_userid`` method, all third-party custom authentication
1240   policies now must implement this method.  It, however, will only be called
1241   when the global function named ``pyramid.security.unauthenticated_userid``
1242   is invoked, so if you're not invoking that, you will not notice any issues.
1243
1244 - ``pyramid.interfaces.ISession.get_csrf_token`` now mandates that an
1245   implementation should return a *new* token if one doesn't already exist in
1246   the session (previously it would return None).  The internal sessioning
1247   implementation has been changed.
1248
1249 Documentation
1250 -------------
1251
1252 - The (weak) "Converting a CMF Application to Pyramid" tutorial has been
1253   removed from the tutorials section.  It was moved to the
1254   ``pyramid_tutorials`` Github repository.
1255
1256 - The "Resource Location and View Lookup" chapter has been replaced with a
1257   variant of Rob Miller's "Much Ado About Traversal" (originally published at
1258   http://blog.nonsequitarian.org/2010/much-ado-about-traversal/).
1259
1260 - Many minor wording tweaks and refactorings (merged Casey Duncan's docs
1261   fork, in which he is working on general editing).
1262
1263 - Added (weak) description of new view mapper feature to Hooks narrative
1264   chapter.
1265
1266 - Split views chapter into 2: View Callables and View Configuration.
1267
1268 - Reorder Renderers and Templates chapters after View Callables but before
1269   View Configuration.
1270
1271 - Merge Session Objects, Cross-Site Request Forgery, and Flash Messaging
1272   chapter into a single Sessions chapter.
1273
1274 - The Wiki and Wiki2 tutorials now have much nicer CSS and graphics.
1275
1276 Internals
1277 ---------
1278
1279 - The "view derivation" code is now factored into a set of classes rather
1280   than a large number of standalone functions (a side effect of the
1281   view mapper refactoring).
1282
1283 - The ``pyramid.renderer.RendererHelper`` class has grown a ``render_view``
1284   method, which is used by the default view mapper (a side effect of the
1285   view mapper refactoring).
1286
1287 - The object passed as ``renderer`` to the "view deriver" is now an instance
1288   of ``pyramid.renderers.RendererHelper`` rather than a dictionary (a side
1289   effect of view mapper refactoring).
1290
1291 - The class used as the "page template" in ``pyramid.chameleon_text`` was
1292   removed, in preference to using a Chameleon-inbuilt version.
1293
1294 - A view callable wrapper registered in the registry now contains an
1295   ``__original_view__`` attribute which references the original view callable
1296   (or class).
1297
1298 - The (non-API) method of all internal authentication policy implementations
1299   previously named ``_get_userid`` is now named ``unauthenticated_userid``,
1300   promoted to an API method.  If you were overriding this method, you'll now
1301   need to override it as ``unauthenticated_userid`` instead.
1302
1303 - Remove (non-API) function of config.py named _map_view.
1304
1305 1.0a8 (2010-12-27)
1306 ==================
1307
1308 Bug Fixes
1309 ---------
1310
1311 - The name ``registry`` was not available in the ``paster pshell``
1312   environment under IPython.
1313
1314 Features
1315 --------
1316
1317 - If a resource implements a ``__resource_url__`` method, it will be called
1318   as the result of invoking the ``pyramid.url.resource_url`` function to
1319   generate a URL, overriding the default logic.  See the new "Generating The
1320   URL Of A Resource" section within the Resources narrative chapter.
1321
1322 - Added flash messaging, as described in the "Flash Messaging" narrative
1323   documentation chapter.
1324
1325 - Added CSRF token generation, as described in the narrative chapter entitled
1326   "Preventing Cross-Site Request Forgery Attacks".
1327
1328 - Prevent misunderstanding of how the ``view`` and ``view_permission``
1329   arguments to add_route work by raising an exception during configuration if
1330   view-related arguments exist but no ``view`` argument is passed.
1331
1332 - Add ``paster proute`` command which displays a summary of the routing
1333   table.  See the narrative documentation section within the "URL Dispatch"
1334   chapter entitled "Displaying All Application Routes".
1335
1336 Paster Templates
1337 ----------------
1338
1339 - The ``pyramid_zodb`` Paster template no longer employs ZCML.  Instead, it
1340   is based on scanning.
1341
1342 Documentation
1343 -------------
1344
1345 - Added "Generating The URL Of A Resource" section to the Resources narrative
1346   chapter (includes information about overriding URL generation using
1347   ``__resource_url__``).
1348
1349 - Added "Generating the Path To a Resource" section to the Resources
1350   narrative chapter.
1351
1352 - Added "Finding a Resource by Path" section to the Resources narrative
1353   chapter.
1354
1355 - Added "Obtaining the Lineage of a Resource" to the Resources narrative
1356   chapter.
1357
1358 - Added "Determining if a Resource is In The Lineage of Another Resource" to
1359   Resources narrative chapter.
1360
1361 - Added "Finding the Root Resource" to Resources narrative chapter.
1362
1363 - Added "Finding a Resource With a Class or Interface in Lineage" to
1364   Resources narrative chapter.
1365
1366 - Added a "Flash Messaging" narrative documentation chapter.
1367
1368 - Added a narrative chapter entitled "Preventing Cross-Site Request Forgery
1369   Attacks".
1370
1371 - Changed the "ZODB + Traversal Wiki Tutorial" based on changes to
1372   ``pyramid_zodb`` Paster template.
1373
1374 - Added "Advanced Configuration" narrative chapter which documents how to
1375   deal with configuration conflicts, two-phase configuration, ``include`` and
1376   ``commit``.
1377
1378 - Fix API documentation rendering for ``pyramid.view.static``
1379
1380 - Add "Pyramid Provides More Than One Way to Do It" to Design Defense
1381   documentation.
1382
1383 - Changed "Static Assets" narrative chapter: clarify that ``name`` represents
1384   a prefix unless it's a URL, added an example of a root-relative static view
1385   fallback for URL dispatch, added an example of creating a simple view that
1386   returns the body of a file.
1387
1388 - Move ZCML usage in Hooks chapter to Declarative Configuration chapter.
1389
1390 - Merge "Static Assets" chapter into the "Assets" chapter.
1391
1392 - Added narrative documentation section within the "URL Dispatch" chapter
1393   entitled "Displaying All Application Routes" (for ``paster proutes``
1394   command).
1395
1396 1.0a7 (2010-12-20)
1397 ==================
1398
1399 Terminology Changes
1400 -------------------
1401
1402 - The Pyramid concept previously known as "model" is now known as "resource".
1403   As a result:
1404
1405   - The following API changes have been made::
1406
1407       pyramid.url.model_url -> 
1408                         pyramid.url.resource_url
1409
1410       pyramid.traversal.find_model -> 
1411                         pyramid.url.find_resource
1412
1413       pyramid.traversal.model_path ->
1414                         pyramid.traversal.resource_path
1415
1416       pyramid.traversal.model_path_tuple ->
1417                         pyramid.traversal.resource_path_tuple
1418
1419       pyramid.traversal.ModelGraphTraverser -> 
1420                         pyramid.traversal.ResourceTreeTraverser
1421
1422       pyramid.config.Configurator.testing_models ->
1423                         pyramid.config.Configurator.testing_resources
1424
1425       pyramid.testing.registerModels ->
1426                         pyramid.testing.registerResources
1427
1428       pyramid.testing.DummyModel ->
1429                         pyramid.testing.DummyResource
1430
1431    - All documentation which previously referred to "model" now refers to
1432      "resource".
1433
1434    - The ``starter`` and ``starter_zcml`` paster templates now have a
1435      ``resources.py`` module instead of a ``models.py`` module.
1436
1437   - Positional argument names of various APIs have been changed from
1438     ``model`` to ``resource``.
1439
1440   Backwards compatibility shims have been left in place in all cases.  They
1441   will continue to work "forever".
1442
1443 - The Pyramid concept previously known as "resource" is now known as "asset".
1444   As a result:
1445
1446   - The (non-API) module previously known as ``pyramid.resource`` is now
1447     known as ``pyramid.asset``.
1448
1449   - All docs that previously referred to "resource specification" now refer
1450     to "asset specification".
1451
1452   - The following API changes were made::
1453
1454       pyramid.config.Configurator.absolute_resource_spec ->
1455                         pyramid.config.Configurator.absolute_asset_spec
1456
1457       pyramid.config.Configurator.override_resource ->
1458                         pyramid.config.Configurator.override_asset
1459
1460   - The ZCML directive previously known as ``resource`` is now known as
1461     ``asset``.
1462
1463   - The setting previously known as ``BFG_RELOAD_RESOURCES`` (envvar) or
1464     ``reload_resources`` (config file) is now known, respectively, as
1465     ``PYRAMID_RELOAD_ASSETS`` and ``reload_assets``.
1466
1467   Backwards compatibility shims have been left in place in all cases.  They
1468   will continue to work "forever".
1469
1470 Bug Fixes
1471 ---------
1472
1473 - Make it possible to succesfully run all tests via ``nosetests`` command
1474   directly (rather than indirectly via ``python setup.py nosetests``).
1475
1476 - When a configuration conflict is encountered during scanning, the conflict
1477   exception now shows the decorator information that caused the conflict.
1478
1479 Features
1480 --------
1481
1482 - Added ``debug_routematch`` configuration setting that logs matched routes
1483   (including the matchdict and predicates).
1484
1485 - The name ``registry`` is now available in a ``pshell`` environment by
1486   default.  It is the application registry object.
1487
1488 Environment
1489 -----------
1490
1491 - All environment variables which used to be prefixed with ``BFG_`` are now
1492   prefixed with ``PYRAMID_`` (e.g. ``BFG_DEBUG_NOTFOUND`` is now
1493   ``PYRAMID_DEBUG_NOTFOUND``)
1494
1495 Documentation
1496 -------------
1497
1498 - Added "Debugging Route Matching" section to the urldispatch narrative
1499   documentation chapter.
1500
1501 - Added reference to ``PYRAMID_DEBUG_ROUTEMATCH`` envvar and ``debug_routematch``
1502   config file setting to the Environment narrative docs chapter.
1503
1504 - Changed "Project" chapter slightly to expand on use of ``paster pshell``.
1505
1506 - Direct Jython users to Mako rather than Jinja2 in "Install" narrative
1507   chapter.
1508
1509 - Many changes to support terminological renaming of "model" to "resource"
1510   and "resource" to "asset".
1511
1512 - Added an example of ``WebTest`` functional testing to the testing narrative
1513   chapter.
1514
1515 - Rearranged chapter ordering by popular demand (URL dispatch first, then
1516   traversal).  Put hybrid chapter after views chapter.
1517
1518 - Split off "Renderers" as its own chapter from "Views" chapter in narrative
1519   documentation.
1520
1521 Paster Templates
1522 ----------------
1523
1524 - Added ``debug_routematch = false`` to all paster templates.
1525
1526 Dependencies
1527 ------------
1528
1529 - Depend on Venusian >= 0.5 (for scanning conflict exception decoration).
1530
1531 1.0a6 (2010-12-15)
1532 ==================
1533
1534 Bug Fixes
1535 ---------
1536
1537 - 1.0a5 introduced a bug when ``pyramid.config.Configurator.scan`` was used
1538   without a ``package`` argument (e.g. ``config.scan()`` as opposed to
1539   ``config.scan('packagename')``.  The symptoms were: lots of deprecation
1540   warnings printed to the console about imports of deprecated Pyramid
1541   functions and classes and non-detection of view callables decorated with
1542   ``view_config`` decorators.  This has been fixed.
1543
1544 - Tests now pass on Windows (no bugs found, but a few tests in the test suite
1545   assumed UNIX path segments in filenames).
1546
1547 Documentation
1548 -------------
1549
1550 - If you followed it to-the-letter, the ZODB+Traversal Wiki tutorial would
1551   instruct you to run a test which would fail because the view callable
1552   generated by the ``pyramid_zodb`` tutorial used a one-arg view callable,
1553   but the test in the sample code used a two-arg call.
1554
1555 - Updated ZODB+Traversal tutorial setup.py of all steps to match what's
1556   generated by ``pyramid_zodb``.
1557
1558 - Fix reference to ``repoze.bfg.traversalwrapper`` in "Models" chapter (point
1559   at ``pyramid_traversalwrapper`` instead).
1560
1561 1.0a5 (2010-12-14)
1562 ==================
1563
1564 Features
1565 --------
1566
1567 - Add a ``handler`` ZCML directive.  This directive does the same thing as
1568   ``pyramid.configuration.add_handler``.
1569
1570 - A new module named ``pyramid.config`` was added.  It subsumes the duties of
1571   the older ``pyramid.configuration`` module.
1572
1573 - The new ``pyramid.config.Configurator` class has API methods that the older
1574   ``pyramid.configuration.Configurator`` class did not: ``with_context`` (a
1575   classmethod), ``include``, ``action``, and ``commit``.  These methods exist
1576   for imperative application extensibility purposes.
1577
1578 - The ``pyramid.testing.setUp`` function now accepts an ``autocommit``
1579   keyword argument, which defaults to ``True``.  If it is passed ``False``,
1580   the Config object returned by ``setUp`` will be a non-autocommiting Config
1581   object.
1582
1583 - Add logging configuration to all paster templates.
1584
1585 - ``pyramid_alchemy``, ``pyramid_routesalchemy``, and ``pylons_sqla`` paster
1586   templates now use idiomatic SQLAlchemy configuration in their respective
1587   ``.ini`` files and Python code.
1588
1589 - ``pyramid.testing.DummyRequest`` now has a class variable,
1590   ``query_string``, which defaults to the empty string.
1591
1592 - Add support for json on GAE by catching NotImplementedError and importing
1593   simplejson from django.utils.
1594
1595 - The Mako renderer now accepts a resource specification for
1596   ``mako.module_directory``.
1597
1598 - New boolean Mako settings variable ``mako.strict_undefined``.  See `Mako
1599   Context Variables
1600   <http://www.makotemplates.org/docs/runtime.html#context-variables>`_ for
1601   its meaning.
1602
1603 Dependencies
1604 ------------
1605
1606 - Depend on Mako 0.3.6+ (we now require the ``strict_undefined`` feature).
1607
1608 Bug Fixes
1609 ---------
1610
1611 - When creating a Configurator from within a ``paster pshell`` session, you
1612   were required to pass a ``package`` argument although ``package`` is not
1613   actually required.  If you didn't pass ``package``, you would receive an
1614   error something like ``KeyError: '__name__'`` emanating from the
1615   ``pyramid.path.caller_module`` function.  This has now been fixed.
1616
1617 - The ``pyramid_routesalchemy`` paster template's unit tests failed
1618   (``AssertionError: 'SomeProject' != 'someproject'``).  This is fixed.
1619
1620 - Make default renderer work (renderer factory registered with no name, which
1621   is active for every view unless the view names a specific renderer).
1622
1623 - The Mako renderer did not properly turn the ``mako.imports``,
1624   ``mako.default_filters``, and ``mako.imports`` settings into lists.
1625
1626 - The Mako renderer did not properly convert the ``mako.error_handler``
1627   setting from a dotted name to a callable.
1628
1629 Documentation
1630 -------------
1631
1632 - Merged many wording, readability, and correctness changes to narrative
1633   documentation chapters from https://github.com/caseman/pyramid (up to and
1634   including "Models" narrative chapter).
1635
1636 - "Sample Applications" section of docs changed to note existence of Cluegun,
1637   Shootout and Virginia sample applications, ported from their repoze.bfg
1638   origin packages.
1639
1640 - SQLAlchemy+URLDispatch tutorial updated to integrate changes to
1641   ``pyramid_routesalchemy`` template.
1642
1643 - Add ``pyramid.interfaces.ITemplateRenderer`` interface to Interfaces API
1644   chapter (has ``implementation()`` method, required to be used when getting
1645   at Chameleon macros).
1646
1647 - Add a "Modifying Package Structure" section to the project narrative
1648   documentation chapter (explain turning a module into a package).
1649
1650 - Documentation was added for the new ``handler`` ZCML directive in the ZCML
1651   section.
1652
1653 Deprecations
1654 ------------
1655
1656 - ``pyramid.configuration.Configurator`` is now deprecated.  Use
1657   ``pyramid.config.Configurator``, passing its constructor
1658   ``autocommit=True`` instead.  The ``pyramid.configuration.Configurator``
1659   alias will live for a long time, as every application uses it, but its
1660   import now issues a deprecation warning.  The
1661   ``pyramid.config.Configurator`` class has the same API as
1662   ``pyramid.configuration.Configurator`` class, which it means to replace,
1663   except by default it is a *non-autocommitting* configurator. The
1664   now-deprecated ``pyramid.configuration.Configurator`` will autocommit every
1665   time a configuration method is called.
1666
1667   The ``pyramid.configuration`` module remains, but it is deprecated.  Use
1668   ``pyramid.config`` instead.
1669
1670 1.0a4 (2010-11-21)
1671 ==================
1672
1673 Features
1674 --------
1675
1676 - URL Dispatch now allows for replacement markers to be located anywhere
1677   in the pattern, instead of immediately following a ``/``.
1678
1679 - URL Dispatch now uses the form ``{marker}`` to denote a replace marker in
1680   the route pattern instead of ``:marker``. The old colon-style marker syntax
1681   is still accepted for backwards compatibility. The new format allows a
1682   regular expression for that marker location to be used instead of the
1683   default ``[^/]+``, for example ``{marker:\d+}`` is now valid to require the
1684   marker to be digits.
1685
1686 - Add a ``pyramid.url.route_path`` API, allowing folks to generate relative
1687   URLs.  Calling ``route_path`` is the same as calling
1688   ``pyramid.url.route_url`` with the argument ``_app_url`` equal to the empty
1689   string.
1690
1691 - Add a ``pyramid.request.Request.route_path`` API.  This is a convenience
1692   method of the request which calls ``pyramid.url.route_url``.
1693
1694 - Make test suite pass on Jython (requires PasteScript trunk, presumably to
1695   be 1.7.4).
1696
1697 - Make test suite pass on PyPy (Chameleon doesn't work).
1698
1699 - Surrounding application configuration with ``config.begin()`` and
1700   ``config.end()`` is no longer necessary.  All paster templates have been
1701   changed to no longer call these functions.
1702
1703 - Fix configurator to not convert ``ImportError`` to ``ConfigurationError``
1704   if the import that failed was unrelated to the import requested via a
1705   dotted name when resolving dotted names (such as view dotted names).
1706
1707 Documentation
1708 -------------
1709
1710 - SQLAlchemy+URLDispatch and ZODB+Traversal tutorials have been updated to
1711   not call ``config.begin()`` or ``config.end()``.
1712
1713 Bug Fixes
1714 ---------
1715
1716 - Add deprecation warnings to import of ``pyramid.chameleon_text`` and
1717   ``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``,
1718   ``render_template``, and ``render_template_to_response``.
1719
1720 - Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and
1721   ``pyramid.zcml.file_configure``.
1722
1723 - The ``pyramid_alchemy`` paster template had a typo, preventing an import
1724   from working.
1725
1726 - Fix apparent failures when calling ``pyramid.traversal.find_model(root,
1727   path)`` or ``pyramid.traversal.traverse(path)`` when ``path`` is
1728   (erroneously) a Unicode object. The user is meant to pass these APIs a
1729   string object, never a Unicode object.  In practice, however, users indeed
1730   pass Unicode.  Because the string that is passed must be ASCII encodeable,
1731   now, if they pass a Unicode object, its data is eagerly converted to an
1732   ASCII string rather than being passed along to downstream code as a
1733   convenience to the user and to prevent puzzling second-order failures from
1734   cropping up (all failures will occur within ``pyramid.traversal.traverse``
1735   rather than later down the line as the result of calling e.g.
1736   ``traversal_path``).
1737
1738 Backwards Incompatibilities
1739 ---------------------------
1740
1741 - The ``pyramid.testing.zcml_configure`` API has been removed.  It had been
1742   advertised as removed since repoze.bfg 1.2a1, but hadn't actually been.
1743
1744 Deprecations
1745 ------------
1746
1747 - The ``pyramid.settings.get_settings`` API is now deprecated.  Use
1748   ``pyramid.threadlocals.get_current_registry().settings`` instead or use the
1749   ``settings`` attribute of the registry available from the request
1750   (``request.registry.settings``).
1751
1752 Documentation
1753 -------------
1754
1755 - Removed ``zodbsessions`` tutorial chapter.  It's still useful, but we now
1756   have a SessionFactory abstraction which competes with it, and maintaining
1757   documentation on both ways to do it is a distraction.
1758
1759 Internal
1760 --------
1761
1762 - Replace Twill with WebTest in internal integration tests (avoid deprecation
1763   warnings generated by Twill).
1764
1765 1.0a3 (2010-11-16)
1766 ==================
1767
1768 Features
1769 --------
1770
1771 - Added Mako TemplateLookup settings for ``mako.error_handler``,
1772   ``mako.default_filters``, and ``mako.imports``.
1773
1774 - Normalized all paster templates: each now uses the name ``main`` to
1775   represent the function that returns a WSGI application, each now uses
1776   WebError, each now has roughly the same shape of development.ini style.
1777
1778 - Added class vars ``matchdict`` and ``matched_route`` to
1779   ``pyramid.request.Request``.  Each is set to ``None``.
1780
1781 - New API method: ``pyramid.settings.asbool``.
1782
1783 - New API methods for ``pyramid.request.Request``: ``model_url``,
1784   ``route_url``, and ``static_url``.  These are simple passthroughs for their
1785   respective functions in ``pyramid.url``.
1786
1787 - The ``settings`` object which used to be available only when
1788   ``request.settings.get_settings`` was called is now available as
1789   ``registry.settings`` (e.g. ``request.registry.settings`` in view code).
1790
1791 Bug Fixes
1792 ---------
1793
1794 - The pylons_* paster templates erroneously used the ``{squiggly}`` routing
1795   syntax as the pattern supplied to ``add_route``.  This style of routing is
1796   not supported.  They were replaced with ``:colon`` style route patterns.
1797
1798 - The pylons_* paster template used the same string
1799   (``your_app_secret_string``) for the ``session.secret`` setting in the
1800   generated ``development.ini``.  This was a security risk if left unchanged
1801   in a project that used one of the templates to produce production
1802   applications.  It now uses a randomly generated string.
1803
1804 Documentation
1805 -------------
1806
1807 - ZODB+traversal wiki (``wiki``) tutorial updated due to changes to
1808   ``pyramid_zodb`` paster template.
1809
1810 - SQLAlchemy+urldispach wiki (``wiki2``) tutorial updated due to changes to
1811   ``pyramid_routesalchemy`` paster template.
1812
1813 - Documented the ``matchdict`` and ``matched_route`` attributes of the
1814   request object in the Request API documentation.
1815
1816 Deprecations
1817 ------------
1818
1819 - Obtaining the ``settings`` object via
1820   ``registry.{get|query}Utility(ISettings)`` is now deprecated.  Instead,
1821   obtain the ``settings`` object via the ``registry.settings`` attribute.  A
1822   backwards compatibility shim was added to the registry object to register
1823   the settings object as an ISettings utility when ``setattr(registry,
1824   'settings', foo)`` is called, but it will be removed in a later release.
1825
1826 - Obtaining the ``settings`` object via ``pyramid.settings.get_settings`` is
1827   now deprecated.  Obtain it as the ``settings`` attribute of the registry
1828   now (obtain the registry via ``pyramid.threadlocal.get_registry`` or as
1829   ``request.registry``).
1830
1831 Behavior Differences
1832 --------------------
1833
1834 - Internal: ZCML directives no longer call get_current_registry() if there's
1835   a ``registry`` attribute on the ZCML context (kill off use of
1836   threadlocals).
1837
1838 - Internal: Chameleon template renderers now accept two arguments: ``path``
1839   and ``lookup``.  ``Lookup`` will be an instance of a lookup class which
1840   supplies (late-bound) arguments for debug, reload, and translate.  Any
1841   third-party renderers which use (the non-API) function
1842   ``pyramid.renderers.template_renderer_factory`` will need to adjust their
1843   implementations to obey the new callback argument list.  This change was to
1844   kill off inappropriate use of threadlocals.
1845
1846 1.0a2 (2010-11-09)
1847 ==================
1848
1849 Documentation
1850 -------------
1851
1852 - All references to events by interface
1853   (e.g. ``pyramid.interfaces.INewRequest``) have been changed to reference
1854   their concrete classes (e.g. ``pyramid.events.NewRequest``) in
1855   documentation about making subscriptions.
1856
1857 - All references to Pyramid-the-application were changed from mod-`pyramid`
1858   to app-`Pyramid`.  A custom role setting was added to ``docs/conf.py`` to
1859   allow for this.  (internal)
1860
1861 1.0a1 (2010-11-05)
1862 ==================
1863
1864 Features (delta from BFG 1.3)
1865 -------------------------------
1866
1867 - Mako templating renderer supports resource specification format for
1868   template lookups and within Mako templates. Absolute filenames must
1869   be used in Pyramid to avoid this lookup process.
1870
1871 - Add ``pyramid.httpexceptions`` module, which is a facade for the
1872   ``webob.exc`` module.
1873
1874 - Direct built-in support for the Mako templating language.
1875
1876 - A new configurator method exists: ``add_handler``.  This method adds
1877   a Pylons-style "view handler" (such a thing used to be called a
1878   "controller" in Pylons 1.0).
1879
1880 - New argument to configurator: ``session_factory``.
1881
1882 - New method on configurator: ``set_session_factory``
1883
1884 - Using ``request.session`` now returns a (dictionary-like) session
1885   object if a session factory has been configured.
1886
1887 - The request now has a new attribute: ``tmpl_context`` for benefit of
1888   Pylons users.
1889
1890 - The decorator previously known as ``pyramid.view.bfg_view`` is now
1891   known most formally as ``pyramid.view.view_config`` in docs and
1892   paster templates.  An import of ``pyramid.view.bfg_view``, however,
1893   will continue to work "forever".
1894
1895 - New API methods in ``pyramid.session``: ``signed_serialize`` and
1896   ``signed_deserialize``.
1897
1898 - New interface: ``pyramid.interfaces.IRendererInfo``.  An object of this type
1899   is passed to renderer factory constructors (see "Backwards
1900   Incompatibilities").
1901
1902 - New event type: ``pyramid.interfaces.IBeforeRender``.  An object of this type
1903   is sent as an event before a renderer is invoked (but after the
1904   application-level renderer globals factory added via
1905   ``pyramid.configurator.configuration.set_renderer_globals_factory``, if any,
1906   has injected its own keys).  Applications may now subscribe to the
1907   ``IBeforeRender`` event type in order to introspect the and modify the set of
1908   renderer globals before they are passed to a renderer.  The event object
1909   iself has a dictionary-like interface that can be used for this purpose.  For
1910   example::
1911
1912     from repoze.events import subscriber
1913     from pyramid.interfaces import IRendererGlobalsEvent
1914
1915     @subscriber(IRendererGlobalsEvent)
1916     def add_global(event):
1917         event['mykey'] = 'foo'
1918
1919   If a subscriber attempts to add a key that already exist in the renderer
1920   globals dictionary, a ``KeyError`` is raised.  This limitation is due to the
1921   fact that subscribers cannot be ordered relative to each other.  The set of
1922   keys added to the renderer globals dictionary by all subscribers and
1923   app-level globals factories must be unique.
1924
1925 - New class: ``pyramid.response.Response``.  This is a pure facade for
1926   ``webob.Response`` (old code need not change to use this facade, it's
1927   existence is mostly for vanity and documentation-generation purposes).
1928
1929 - All preexisting paster templates (except ``zodb``) now use "imperative"
1930   configuration (``starter``, ``routesalchemy``, ``alchemy``).
1931
1932 - A new paster template named ``pyramid_starter_zcml`` exists, which uses
1933   declarative configuration.
1934
1935 Documentation (delta from BFG 1.3)
1936 -----------------------------------
1937
1938 - Added a ``pyramid.httpexceptions`` API documentation chapter.
1939
1940 - Added a ``pyramid.session`` API documentation chapter.
1941
1942 - Added a ``Session Objects`` narrative documentation chapter.
1943
1944 - Added an API chapter for the ``pyramid.personality`` module.
1945
1946 - Added an API chapter for the ``pyramid.response`` module.
1947
1948 - All documentation which previously referred to ``webob.Response`` now uses
1949   ``pyramid.response.Response`` instead.
1950
1951 - The documentation has been overhauled to use imperative configuration,
1952   moving declarative configuration (ZCML) explanations to a separate
1953   narrative chapter ``declarative.rst``.
1954
1955 - The ZODB Wiki tutorial was updated to take into account changes to the
1956   ``pyramid_zodb`` paster template.
1957
1958 - The SQL Wiki tutorial was updated to take into account changes to the
1959   ``pyramid_routesalchemy`` paster template.
1960
1961 Backwards Incompatibilities (with BFG 1.3)
1962 ------------------------------------------
1963
1964 - There is no longer an ``IDebugLogger`` registered as a named utility
1965   with the name ``repoze.bfg.debug``.
1966
1967 - The logger which used to have the name of ``repoze.bfg.debug`` now
1968   has the name ``pyramid.debug``.
1969
1970 - The deprecated API ``pyramid.testing.registerViewPermission``
1971   has been removed.
1972
1973 - The deprecated API named ``pyramid.testing.registerRoutesMapper``
1974   has been removed.
1975
1976 - The deprecated API named ``pyramid.request.get_request`` was removed.
1977
1978 - The deprecated API named ``pyramid.security.Unauthorized`` was
1979   removed.
1980
1981 - The deprecated API named ``pyramid.view.view_execution_permitted``
1982   was removed.
1983
1984 - The deprecated API named ``pyramid.view.NotFound`` was removed.
1985
1986 - The ``bfgshell`` paster command is now named ``pshell``.
1987
1988 - The Venusian "category" for all built-in Venusian decorators
1989   (e.g. ``subscriber`` and ``view_config``/``bfg_view``) is now
1990   ``pyramid`` instead of ``bfg``.
1991
1992 - ``pyramid.renderers.rendered_response`` function removed; use
1993   ``render_pyramid.renderers.render_to_response`` instead.
1994
1995 - Renderer factories now accept a *renderer info object* rather than an
1996   absolute resource specification or an absolute path.  The object has the
1997   following attributes: ``name`` (the ``renderer=`` value), ``package`` (the
1998   'current package' when the renderer configuration statement was found),
1999   ``type``: the renderer type, ``registry``: the current registry, and
2000   ``settings``: the deployment settings dictionary.
2001
2002   Third-party ``repoze.bfg`` renderer implementations that must be ported to
2003   Pyramid will need to account for this.
2004
2005   This change was made primarily to support more flexible Mako template
2006   rendering.
2007
2008 - The presence of the key ``repoze.bfg.message`` in the WSGI environment when
2009   an exception occurs is now deprecated.  Instead, code which relies on this
2010   environ value should use the ``exception`` attribute of the request
2011   (e.g. ``request.exception[0]``) to retrieve the message.
2012
2013 - The values ``bfg_localizer`` and ``bfg_locale_name`` kept on the request
2014   during internationalization for caching purposes were never APIs.  These
2015   however have changed to ``localizer`` and ``locale_name``, respectively.
2016
2017 - The default ``cookie_name`` value of the ``authtktauthenticationpolicy`` ZCML
2018   now defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
2019
2020 - The default ``cookie_name`` value of the
2021   ``pyramid.authentication.AuthTktAuthenticationPolicy`` constructor now
2022   defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
2023
2024 - The ``request_type`` argument to the ``view`` ZCML directive, the
2025   ``pyramid.configuration.Configurator.add_view`` method, or the
2026   ``pyramid.view.view_config`` decorator (nee ``bfg_view``) is no longer
2027   permitted to be one of the strings ``GET``, ``HEAD``, ``PUT``, ``POST`` or
2028   ``DELETE``, and now must always be an interface.  Accepting the
2029   method-strings as ``request_type`` was a backwards compatibility strategy
2030   servicing repoze.bfg 1.0 applications.  Use the ``request_method``
2031   parameter instead to specify that a view a string request-method predicate.
4cdffc 2032