Michael Merickel
2018-10-26 9c086aac7c53399506eb68f29b296ebbfb8e29d4
commit | author | age
b7c935 1 1.3b1 (2010-10-25)
CM 2 ==================
3
4 Features
5 --------
6
7 - The ``paster`` template named ``bfg_routesalchemy`` has been updated
8   to use SQLAlchemy declarative syntax.  Thanks to Ergo^.
9
10 Bug Fixes
11 ---------
12
13 - When a renderer factory could not be found, a misleading error
14   message was raised if the renderer name was not a string.
15
16 Documentation
17 -------------
18
19 - The ""bfgwiki2" (SQLAlchemy + url dispatch) tutorial has been
20   updated slightly.  In particular, the source packages no longer
21   attempt to use a private index, and the recommended Python version
22   is now 2.6.  It was also updated to take into account the changes to
23   the ``bfg_routesalchemy`` template used to set up an environment.
24
25 - The "bfgwiki" (ZODB + traversal) tutorial has been updated slightly.
26   In particular, the source packages no longer attempt to use a
27   private index, and the recommended Python version is now 2.6.
28
29 1.3a15 (2010-09-30)
30 ===================
31
32 Features
33 --------
34
35 - The ``repoze.bfg.traversal.traversal_path`` API now eagerly attempts
36   to encode a Unicode ``path`` into ASCII before attempting to split
37   it and decode its segments.  This is for convenience, effectively to
38   allow a (stored-as-Unicode-in-a-database, or
39   retrieved-as-Unicode-from-a-request-parameter) Unicode path to be
40   passed to ``find_model``, which eventually internally uses the
41   ``traversal_path`` function under the hood.  In version 1.2 and
42   prior, if the ``path`` was Unicode, that Unicode was split on
43   slashes and each resulting segment value was Unicode.  An
44   inappropriate call to the ``decode()`` method of a resulting Unicode
45   path segment could cause a ``UnicodeDecodeError`` to occur even if
46   the Unicode representation of the path contained no 'high order'
47   characters (it effectively did a "double decode").  By converting
48   the Unicode path argument to ASCII before we attempt to decode and
49   split, genuine errors will occur in a more obvious place while also
50   allowing us to handle (for convenience) the case that it's a Unicode
51   representation formed entirely from ASCII-compatible characters.
52
53 1.3a14 (2010-09-14)
54 ===================
55
56 Bug Fixes
57 ---------
58
59 - If an exception view was registered through the legacy
60   ``set_notfound_view`` or ``set_forbidden_view`` APIs, the context
61   sent to the view was incorrect (could be ``None`` inappropriately).
62
63 Features
64 --------
65
66 - Compatibility with WebOb 1.0.
67
68 Requirements
69 ------------
70
71 - Now requires WebOb >= 1.0.
72
73 Backwards Incompatibilities
74 ---------------------------
75
76 - Due to changes introduced WebOb 1.0, the
77   ``repoze.bfg.request.make_request_ascii`` event subscriber no longer
78   works, so it has been removed.  This subscriber was meant to be used
79   in a deployment so that code written before BFG 0.7.0 could run
80   unchanged.  At this point, such code will need to be rewritten to
81   expect Unicode from ``request.GET``, ``request.POST`` and
82   ``request.params`` or it will need to be changed to use
83   ``request.str_POST``, ``request.str_GET`` and/or
84   ``request.str_params`` instead of the non-``str`` versions of same,
85   as the non-``str`` versions of the same APIs always now perform
86   decoding to Unicode.
87
88 Errata
89 ------
90
91 - A prior changelog entry asserted that the ``INewResponse`` event was
92   not sent to listeners if the response was not "valid" (if a view or
93   renderer returned a response object that did not have a
94   status/headers/app_iter).  This is not true in this release, nor was
95   it true in 1.3a13.
96
97 1.3a13 (2010-09-14)
98 ===================
99
100 Bug Fixes
101 ---------
102
103 - The ``traverse`` route predicate could not successfully generate a
104   traversal path.
105
106 Features
107 --------
108
109 - In support of making it easier to configure applications which are
110   "secure by default", a default permission feature was added.  If
111   supplied, the default permission is used as the permission string to
112   all view registrations which don't otherwise name a permission.
113   These APIs are in support of that:
114
115   - A new constructor argument was added to the Configurator:
116     ``default_permission``.
117
118   - A new method was added to the Configurator:
119     ``set_default_permission``.
120
121   - A new ZCML directive was added: ``default_permission``.
122
123 - Add a new request API: ``request.add_finished_callback``.  Finished
124   callbacks are called by the router unconditionally near the very end
125   of request processing.  See the "Using Finished Callbacks" section
126   of the "Hooks" narrative chapter of the documentation for more
127   information.
128
129 - A ``request.matched_route`` attribute is now added to the request
130   when a route has matched.  Its value is the "route" object that
131   matched (see the ``IRoute`` interface within
132   ``repoze.bfg.interfaces`` API documentation for the API of a route
133   object).
134
135 - The ``exception`` attribute of the request is now set slightly
136   earlier and in a slightly different set of scenarios, for benefit of
137   "finished callbacks" and "response callbacks".  In previous
138   versions, the ``exception`` attribute of the request was not set at
139   all if an exception view was not found.  In this version, the
140   ``request.exception`` attribute is set immediately when an exception
141   is caught by the router, even if an exception view could not be
142   found.
143
144 - The ``add_route`` method of a Configurator now accepts a
145   ``pregenerator`` argument.  The pregenerator for the resulting route
146   is called by ``route_url`` in order to adjust the set of arguments
147   passed to it by the user for special purposes, such as Pylons
148   'subdomain' support.  It will influence the URL returned by
149   ``route_url``.  See the ``repoze.bfg.interfaces.IRoutePregenerator``
150   interface for more information.
151
152 Backwards Incompatibilities
153 ---------------------------
154
155 - The router no longer sets the value ``wsgiorg.routing_args`` into
156   the environ when a route matches. The value used to be something
157   like ``((), matchdict)``.  This functionality was only ever
158   obliquely referred to in change logs; it was never documented as an
159   API.
160
161 - The ``exception`` attribute of the request now defaults to ``None``.
162   In prior versions, the ``request.exception`` attribute did not exist
163   if an exception was not raised by user code during request
164   processing; it only began existence once an exception view was
165   found.
166
167 Deprecations
168 ------------
169
170 - The ``repoze.bfg.interfaces.IWSGIApplicationCreatedEvent`` event
171   interface was renamed to
172   ``repoze.bfg.interfaces.IApplicationCreated``.  Likewise, the
173   ``repoze.bfg.events.WSGIApplicationCreatedEvent`` class was renamed
174   to ``repoze.bfg.events.ApplicationCreated``.  The older aliases will
175   continue to work indefinitely.
176
177 - The ``repoze.bfg.interfaces.IAfterTraversal`` event interface was
178   renamed to ``repoze.bfg.interfaces.IContextFound``.  Likewise, the
179   ``repoze.bfg.events.AfterTraversal`` class was renamed to
180   ``repoze.bfg.events.ContextFound``.  The older aliases will continue
181   to work indefinitely.
182
183 - References to the WSGI environment values ``bfg.routes.matchdict``
184   and ``bfg.routes.route`` were removed from documentation.  These
185   will stick around internally for several more releases, but it is
186   ``request.matchdict`` and ``request.matched_route`` are now the
187   "official" way to obtain the matchdict and the route object which
188   resulted in the match.
189
190 Documentation
191 -------------
192
193 - Added documentation for the ``default_permission`` ZCML directive.
194
195 - Added documentation for the ``default_permission`` constructor value
196   and the ``set_default_permission`` method in the Configurator API
197   documentation.
198
199 - Added a new section to the "security" chapter named "Setting a
200   Default Permission".
201
202 - Document ``renderer_globals_factory`` and ``request_factory``
203   arguments to Configurator constructor.
204
205 - Added two sections to the "Hooks" chapter of the documentation:
206   "Using Response Callbacks" and "Using Finished Callbacks".
207
208 - Added documentation of the ``request.exception`` attribute to the
209   ``repoze.bfg.request.Request`` API documentation.
210
211 - Added glossary entries for "response callback" and "finished
212   callback".
213
214 - The "Request Processing" narrative chapter has been updated to note
215   finished and response callback steps.
216
217 - New interface in interfaces API documentation: ``IRoutePregenerator``.
218
219 - Added a "The Matched Route" section to the URL Dispatch narrative
220   docs chapter, detailing the ``matched_route`` attribute.
221
222 1.3a12 (2010-09-08)
223 ===================
224
225 Bug Fixes
226 ---------
227
228 - Fix a bug in ``repoze.bfg.url.static_url`` URL generation: if two
229   resource specifications were used to create two separate static
230   views, but they shared a common prefix, it was possible that
231   ``static_url`` would generate an incorrect URL.
232
233 - Fix another bug in ``repoze.bfg.static_url`` URL generation: too
234   many slashes in generated URL.
235
236 - Prevent a race condition which could result in a ``RuntimeError``
237   when rendering a Chameleon template that has not already been
238   rendered once.  This would usually occur directly after a restart,
239   when more than one person or thread is trying to execute the same
240   view at the same time: https://bugs.launchpad.net/karl3/+bug/621364
241
242 Features
243 --------
244
245 - The argument to ``repoze.bfg.configuration.Configurator.add_route``
246   which was previously called ``path`` is now called ``pattern`` for
247   better explicability.  For backwards compatibility purposes, passing
248   a keyword argument named ``path`` to ``add_route`` will still work
249   indefinitely.
250
251 - The ``path`` attribute to the ZCML ``route`` directive is now named
252   ``pattern`` for better explicability.  The older ``path`` attribute
253   will continue to work indefinitely.
254
255 Documentation
256 -------------
257
258 - All narrative, API, and tutorial docs which referred to a route
259   pattern as a ``path`` have now been updated to refer to them as a
260   ``pattern``.
261
262 - The ``repoze.bfg.interfaces`` API documentation page is now rendered
263   via ``repoze.sphinx.autointerface``.
264
265 - The URL Dispatch narrative chapter now refers to the ``interfaces``
266   chapter to explain the API of an ``IRoute`` object.
267
268 Paster Templates
269 ----------------
270
271 - The routesalchemy template has been updated to use ``pattern`` in
272   its route declarations rather than ``path``.
273
274 Dependencies
275 ------------
276
277 - ``tests_require`` now includes ``repoze.sphinx.autointerface`` as a
278   dependency.
279
280 Internal
281 --------
282
283 - Add an API to the ``Configurator`` named ``get_routes_mapper``.
284   This returns an object implementing the ``IRoutesMapper`` interface.
285
286 - The ``repoze.bfg.urldispatch.RoutesMapper`` object now has a
287   ``get_route`` method which returns a single Route object or
288   ``None``.
289
290 - A new interface ``repoze.bfg.interfaces.IRoute`` was added.  The
291   ``repoze.bfg.urldispatch.Route`` object implements this interface.
292
293 - The canonical attribute for accessing the routing pattern from a
294   route object is now ``pattern`` rather than ``path``.
295
296 - Use ``hash()`` rather than ``id()`` when computing the "phash" of a
297   custom route/view predicate in order to allow the custom predicate
298   some control over which predicates are "equal".
299
300 - Use ``response.headerlist.append`` instead of
301   ``response.headers.add`` in
302   ``repoze.bfg.request.add_global_response_headers`` in case the
303   response is not a WebOb response.
304
305 - The ``repoze.bfg.urldispatch.Route`` constructor (not an API) now
306   accepts a different ordering of arguments.  Previously it was
307   ``(pattern, name, factory=None, predicates=())``.  It is now
308   ``(name, pattern, factory=None, predicates=())``.  This is in
309   support of consistency with ``configurator.add_route``.
310
311 - The ``repoze.bfg.urldispatch.RoutesMapper.connect`` method (not an
312   API) now accepts a different ordering of arguments.  Previously it
313   was ``(pattern, name, factory=None, predicates=())``.  It is now
314   ``(name, pattern, factory=None, predicates=())``.  This is in
315   support of consistency with ``configurator.add_route``.
316
317 1.3a11 (2010-09-05)
318 ===================
319
320 Bug Fixes
321 ---------
322
323 - Process the response callbacks and the NewResponse event earlier, to
324   enable mutations to the response to take effect.
325
326 1.3a10 (2010-09-05)
327 ===================
328
329 Features
330 --------
331
332 - A new ``repoze.bfg.request.Request.add_response_callback`` API has
333   been added.  This method is documented in the new
334   ``repoze.bfg.request`` API chapter.  It can be used to influence
335   response values before a concrete response object has been created.
336
337 - The ``repoze.bfg.interfaces.INewResponse`` interface now includes a
338   ``request`` attribute; as a result, a handler for INewResponse now
339   has access to the request which caused the response.
340
341 - Each of the follow methods of the Configurator now allow the
342   below-named arguments to be passed as "dotted name strings"
343   (e.g. "foo.bar.baz") rather than as actual implementation objects
344   that must be imported:
345
346   setup_registry
347      root_factory, authentication_policy, authorization_policy,
348      debug_logger, locale_negotiator, request_factory,
349      renderer_globals_factory
350
351   add_subscriber
352      subscriber, iface
353
354   derive_view
355      view
356
357   add_view
358      view, ``for_``, context, request_type, containment
359
360   add_route()
361      view, view_for, factory, ``for_``, view_context
362
363   scan
364      package
365
366   add_renderer
367      factory
368
369   set_forbidden_view
370      view
371
372   set_notfound_view
373      view
374
375   set_request_factory
376      factory
377
378   set_renderer_globals_factory()
379      factory
380
381   set_locale_negotiator
382      negotiator
383
384   testing_add_subscriber
385      event_iface
386
387 Bug Fixes
388 ---------
389
043ccd 390 - The route pattern registered internally for a local "static view"
b7c935 391   (either via the ``static`` ZCML directive or via the
CM 392   ``add_static_view`` method of the configurator) was incorrect.  It
393   was regsistered for e.g. ``static*traverse``, while it should have
394   been registered for ``static/*traverse``.  Symptom: two static views
395   could not reliably be added to a system when they both shared the
396   same path prefix (e.g. ``/static`` and ``/static2``).
397
398 Backwards Incompatibilities
399 ---------------------------
400
401 - The INewResponse event is now not sent to listeners if the response
402   returned by view code (or a renderer) is not a "real" response
403   (e.g. if it does not have ``.status``, ``.headerlist`` and
404   ``.app_iter`` attribtues).
405
406 Documentation
407 -------------
408
409 - Add an API chapter for the ``repoze.bfg.request`` module, which
410   includes documentation for the ``repoze.bfg.request.Request`` class
411   (the "request object").
412
413 - Modify the "Request and Response" narrative chapter to reference the
414   new ``repoze.bfg.request`` API chapter.  Some content was moved from
415   this chapter into the API documentation itself.
416
417 - Various changes to denote that Python dotted names are now allowed
418   as input to Configurator methods.
419
420 Internal
421 --------
422
423 - The (internal) feature which made it possible to attach a
424   ``global_response_headers`` attribute to the request (which was
425   assumed to contain a sequence of header key/value pairs which would
426   later be added to the response by the router), has been removed.
427   The functionality of
428   ``repoze.bfg.request.Request.add_response_callback`` takes its
429   place.
430
431 - The ``repoze.bfg.events.NewResponse`` class's construct has changed:
432   it now must be created with ``(request, response)`` rather than
433   simply ``(response)``.
434
435 1.3a9 (2010-08-22)
436 ==================
437
438 Features
439 --------
440
441 - The Configurator now accepts a dotted name *string* to a package as
442   a ``package`` constructor argument. The ``package`` argument was
443   previously required to be a package *object* (not a dotted name
444   string).
445
446 - The ``repoze.bfg.configuration.Configurator.with_package`` method
447   was added.  This method returns a new Configurator using the same
448   application registry as the configurator object it is called
449   upon. The new configurator is created afresh with its ``package``
450   constructor argument set to the value passed to ``with_package``.
451   This feature will make it easier for future BFG versions to allow
452   dotted names as arguments in places where currently only object
453   references are allowed (the work to allow dotted names isntead of
454   object references everywhere has not yet been done, however).
455
456 - The new ``repoze.bfg.configuration.Configurator.maybe_dotted``
457   method resolves a Python dotted name string supplied as its
458   ``dotted`` argument to a global Python object.  If the value cannot
459   be resolved, a ``repoze.bfg.configuration.ConfigurationError`` is
460   raised.  If the value supplied as ``dotted`` is not a string, the
461   value is returned unconditionally without any resolution attempted.
462
463 - The new
464   ``repoze.bfg.configuration.Configurator.absolute_resource_spec``
465   method resolves a potentially relative "resource specification"
466   string into an absolute version.  If the value supplied as
467   ``relative_spec`` is not a string, the value is returned
468   unconditionally without any resolution attempted.
469
470 Backwards Incompatibilities
471 ---------------------------
472
473 - The functions in ``repoze.bfg.renderers`` named ``render`` and
474   ``render_to_response`` introduced in 1.3a6 previously took a set of
475   ``**values`` arguments for the values to be passed to the renderer.
476   This was wrong, as renderers don't need to accept only dictionaries
477   (they can accept any type of object).  Now, the value sent to the
478   renderer must be supplied as a positional argument named ``value``.
479   The ``request`` argument is still a keyword argument, however.
480
481 - The functions in ``repoze.bfg.renderers`` named ``render`` and
482   ``render_to_response`` now accept an additonal keyword argument
483   named ``package``.
484
485 - The ``get_renderer`` API in ``repoze.bfg.renderers`` now accepts a
486   ``package`` argument.
487
488 Documentation
489 -------------
490
491 - The ZCML ``include`` directive docs were incorrect: they specified
492   ``filename`` rather than (the correct) ``file`` as an allowable
493   attribute.
494
495 Internal
496 --------
497
498 - The ``repoze.bfg.resource.resolve_resource_spec`` function can now
499   accept a package object as its ``pname`` argument instead of just a
500   package name.
501
502 - The ``_renderer_factory_from_name`` and ``_renderer_from_name``
503   methods of the Configurator were removed.  These were never APIs.
504
505 - The ``_render``, ``_render_to_response`` and ``_make_response``
506   functions with ``repoze.bfg.render`` (added in 1.3a6) have been
507   removed.
508
509 - A new helper class ``repoze.bfg.renderers.RendererHelper`` was
510   added.
511
512 - The _map_view function of ``repoze.bfg.configuration`` now takes
513   only a renderer_name argument instead of both a ``renderer`` and
514   ``renderer``_name argument.  It also takes a ``package`` argument
515   now.
516
517 - Use ``imp.get_suffixes`` indirection in
518   ``repoze.bfg.path.package_name`` instead of hardcoded ``.py``
519   ``.pyc`` and ``.pyo`` to use for comparison when attemtping to
520   decide if a directory is a package.
521
522 - Make tests runnable again under Jython (although they do not all
523   pass currently).
524
525 - The reify decorator now maintains the docstring of the function it
526   wraps.
527
528 1.3a8 (2010-08-08)
529 ==================
530
531 Features
532 --------
533
534 - New public interface: ``repoze.bfg.exceptions.IExceptionResponse``.
535   This interface is provided by all internal exception classes (such
536   as ``repoze.bfg.exceptions.NotFound`` and
537   ``repoze.bfg.exceptions.Forbidden``), instances of which are both
538   exception objects and can behave as WSGI response objects.  This
539   interface is made public so that exception classes which are also
540   valid WSGI response factories can be configured to implement them or
541   exception instances which are also or response instances can be
542   configured to provide them.
543
544 - New API class: ``repoze.bfg.view.AppendSlashNotFoundViewFactory``.
545
546   There can only be one Not Found view in any ``repoze.bfg``
547   application.  Even if you use
548   ``repoze.bfg.view.append_slash_notfound_view`` as the Not Found
549   view, ``repoze.bfg`` still must generate a ``404 Not Found``
550   response when it cannot redirect to a slash-appended URL; this not
551   found response will be visible to site users.
552
553   If you don't care what this 404 response looks like, and you only
554   need redirections to slash-appended route URLs, you may use the
555   ``repoze.bfg.view.append_slash_notfound_view`` object as the Not
556   Found view.  However, if you wish to use a *custom* notfound view
557   callable when a URL cannot be redirected to a slash-appended URL,
558   you may wish to use an instance of the
559   ``repoze.bfg.view.AppendSlashNotFoundViewFactory`` class as the Not
560   Found view, supplying the notfound view callable as the first
561   argument to its constructor.  For instance::
562
563        from repoze.bfg.exceptions import NotFound
564        from repoze.bfg.view import AppendSlashNotFoundViewFactory
565
566        def notfound_view(context, request):
567            return HTTPNotFound('It aint there, stop trying!')
568
569        custom_append_slash = AppendSlashNotFoundViewFactory(notfound_view)
570        config.add_view(custom_append_slash, context=NotFound)
571
572   The ``notfound_view`` supplied must adhere to the two-argument view
573   callable calling convention of ``(context, request)`` (``context``
574   will be the exception object).
575
576 Documentation
577 --------------
578
579 - Expanded the "Cleaning Up After a Request" section of the URL
580   Dispatch narrative chapter.
581
582 - Expanded the "Redirecting to Slash-Appended Routes" section of the
583   URL Dispatch narrative chapter.
584
585 Internal
586 --------
587
588 - Previously, two default view functions were registered at
589   Configurator setup (one for ``repoze.bfg.exceptions.NotFound`` named
590   ``default_notfound_view`` and one for
591   ``repoze.bfg.exceptions.Forbidden`` named
592   ``default_forbidden_view``) to render internal exception responses.
593   Those default view functions have been removed, replaced with a
594   generic default view function which is registered at Configurator
595   setup for the ``repoze.bfg.interfaces.IExceptionResponse`` interface
596   that simply returns the exception instance; the ``NotFound`` and
597   ``Forbidden`` classes are now still exception factories but they are
598   also response factories which generate instances that implement the
599   new ``repoze.bfg.interfaces.IExceptionResponse`` interface.
600
601 1.3a7 (2010-08-01)
602 ==================
603
604 Features
605 --------
606
607 - The ``repoze.bfg.configuration.Configurator.add_route`` API now
608   returns the route object that was added.
609
610 - A ``repoze.bfg.events.subscriber`` decorator was added.  This
611   decorator decorates module-scope functions, which are then treated
612   as event listeners after a scan() is performed.  See the Events
613   narrative documentation chapter and the ``repoze.bfg.events`` module
614   documentation for more information.
615
616 Bug Fixes
617 ---------
618
619 - When adding a view for a route which did not yet exist ("did not yet
620   exist" meaning, temporally, a view was added with a route name for a
621   route which had not yet been added via add_route), the value of the
622   ``custom_predicate`` argument to ``add_view`` was lost.  Symptom:
623   wrong view matches when using URL dispatch and custom view
624   predicates together.
625
626 - Pattern matches for a ``:segment`` marker in a URL dispatch route
627   pattern now always match at least one character.  See "Backwards
628   Incompatibilities" below in this changelog.
629
630 Backwards Incompatibilities
631 ---------------------------
632
633 - A bug existed in the regular expression to do URL matching.  As an
634   example, the URL matching machinery would cause the pattern
635   ``/{foo}`` to match the root URL ``/`` resulting in a match
636   dictionary of ``{'foo':u''}`` or the pattern ``/{fud}/edit might
637   match the URL ``//edit`` resulting in a match dictionary of
638   ``{'fud':u''}``.  It was always the intent that ``:segment`` markers
639   in the pattern would need to match *at least one* character, and
640   never match the empty string.  This, however, means that in certain
641   circumstances, a routing match which your application inadvertently
642   depended upon may no longer happen.
643
644 Documentation
645 --------------
646
647 - Added description of the ``repoze.bfg.events.subscriber`` decorator
648   to the Events narrative chapter.
649
650 - Added ``repoze.bfg.events.subscriber`` API documentation to
651   ``repoze.bfg.events`` API docs.
652
653 - Added a section named "Zope 3 Enforces 'TTW' Authorization Checks By
654   Default; BFG Does Not" to the "Design Defense" chapter.
655
656 1.3a6 (2010-07-25)
657 ==================
658
659 Features
660 --------
661
662 - New argument to ``repoze.bfg.configuration.Configurator.add_route``
663   and the ``route`` ZCML directive: ``traverse``.  If you would like
664   to cause the ``context`` to be something other than the ``root``
665   object when this route matches, you can spell a traversal pattern as
666   the ``traverse`` argument.  This traversal pattern will be used as
667   the traversal path: traversal will begin at the root object implied
668   by this route (either the global root, or the object returned by the
669   ``factory`` associated with this route).
670
671   The syntax of the ``traverse`` argument is the same as it is for
672   ``path``. For example, if the ``path`` provided is
673   ``articles/:article/edit``, and the ``traverse`` argument provided
674   is ``/:article``, when a request comes in that causes the route to
675   match in such a way that the ``article`` match value is '1' (when
676   the request URI is ``/articles/1/edit``), the traversal path will be
677   generated as ``/1``.  This means that the root object's
678   ``__getitem__`` will be called with the name ``1`` during the
679   traversal phase.  If the ``1`` object exists, it will become the
680   ``context`` of the request.  The Traversal narrative has more
681   information about traversal.
682
683   If the traversal path contains segment marker names which are not
684   present in the path argument, a runtime error will occur.  The
685   ``traverse`` pattern should not contain segment markers that do not
686   exist in the ``path``.
687
688   A similar combining of routing and traversal is available when a
689   route is matched which contains a ``*traverse`` remainder marker in
690   its path.  The ``traverse`` argument allows you to associate route
043ccd 691   patterns with an arbitrary traversal path without using a
b7c935 692   ``*traverse`` remainder marker; instead you can use other match
CM 693   information.
694
695   Note that the ``traverse`` argument is ignored when attached to a
696   route that has a ``*traverse`` remainder marker in its path.
697
698 - A new method of the ``Configurator`` exists:
699   ``set_request_factory``.  If used, this method will set the factory
700   used by the ``repoze.bfg`` router to create all request objects.
701
702 - The ``Configurator`` constructor takes an additional argument:
703   ``request_factory``.  If used, this argument will set the factory
704   used by the ``repoze.bfg`` router to create all request objects.
705
706 - The ``Configurator`` constructor takes an additional argument:
707   ``request_factory``.  If used, this argument will set the factory
708   used by the ``repoze.bfg`` router to create all request objects.
709
710 - A new method of the ``Configurator`` exists:
711   ``set_renderer_globals_factory``.  If used, this method will set the
712   factory used by the ``repoze.bfg`` router to create renderer
713   globals.
714
715 - A new method of the ``Configurator`` exists: ``get_settings``.  If
716   used, this method will return the current settings object (performs
717   the same job as the ``repoze.bfg.settings.get_settings`` API).
718
719 - The ``Configurator`` constructor takes an additional argument:
720   ``renderer_globals_factory``.  If used, this argument will set the
721   factory used by the ``repoze.bfg`` router to create renderer
722   globals.
723
724 - Add ``repoze.bfg.renderers.render``,
725   ``repoze.bfg.renderers.render_to_response`` and
726   ``repoze.bfg.renderers.get_renderer`` functions.  These are
727   imperative APIs which will use the same rendering machinery used by
728   view configurations with a ``renderer=`` attribute/argument to
729   produce a rendering or renderer.  Because these APIs provide a
730   central API for all rendering, they now form the preferred way to
731   perform imperative template rendering.  Using functions named
732   ``render_*`` from modules such as ``repoze.bfg.chameleon_zpt`` and
733   ``repoze.bfg.chameleon_text`` is now discouraged (although not
734   deprecated).  The code the backing older templating-system-specific
735   APIs now calls into the newer ``repoze.bfg.renderer`` code.
736
737 - The ``repoze.bfg.configuration.Configurator.testing_add_template``
738   has been renamed to ``testing_add_renderer``.  A backwards
739   compatibility alias is present using the old name.
740
741 Documentation
742 -------------
743
744 - The ``Hybrid`` narrative chapter now contains a description of the
745   ``traverse`` route argument.
746
747 - The ``Hooks`` narrative chapter now contains sections about
748   changing the request factory and adding a renderer globals factory.
749
750 - The API documentation includes a new module:
751   ``repoze.bfg.renderers``.
752
753 - The ``Templates`` chapter was updated; all narrative that used
754   templating-specific APIs within examples to perform rendering (such
755   as the ``repoze.bfg.chameleon_zpt.render_template_to_response``
756   method) was changed to use ``repoze.bfg.renderers.render_*``
757   functions.
758
759 Bug Fixes
760 ---------
761
762 - The ``header`` predicate (when used as either a view predicate or a
763   route predicate) had a problem when specified with a name/regex
764   pair.  When the header did not exist in the headers dictionary, the
765   regex match could be fed ``None``, causing it to throw a
766   ``TypeError: expected string or buffer`` exception.  Now, the
767   predicate returns False as intended.
768
769 Deprecations
770 ------------
771
772 - The ``repoze.bfg.renderers.rendered_response`` function was never an
773   official API, but may have been imported by extensions in the wild.
774   It is officially deprecated in this release.  Use
775   ``repoze.bfg.renderers.render_to_response`` instead.
776
777 - The following APIs are *documentation* deprecated (meaning they are
778   officially deprecated in documentation but do not raise a
779   deprecation error upon their usage, and may continue to work for an
780   indefinite period of time):
781
782   In the ``repoze.bfg.chameleon_zpt`` module: ``get_renderer``,
783   ``get_template``, ``render_template``,
784   ``render_template_to_response``.  The suggested alternatives are
785   documented within the docstrings of those methods (which are still
786   present in the documentation).
787
788   In the ``repoze.bfg.chameleon_text`` module: ``get_renderer``,
789   ``get_template``, ``render_template``,
790   ``render_template_to_response``.  The suggested alternatives are
791   documented within the docstrings of those methods (which are still
792   present in the documentation).
793
794   In general, to perform template-related functions, one should now
795   use the various methods in the ``repoze.bfg.renderers`` module.
796
797 Backwards Incompatibilities
798 ---------------------------
799
800 - A new internal exception class (*not* an API) named
801   ``repoze.bfg.exceptions.PredicateMismatch`` now exists.  This
802   exception is currently raised when no constituent view of a
803   multiview can be called (due to no predicate match).  Previously, in
804   this situation, a ``repoze.bfg.exceptions.NotFound`` was raised.  We
805   provide backwards compatibility for code that expected a
806   ``NotFound`` to be raised when no predicates match by causing
807   ``repoze.bfg.exceptions.PredicateMismatch`` to inherit from
808   ``NotFound``.  This will cause any exception view registered for
809   ``NotFound`` to be called when a predicate mismatch occurs, as was
810   the previous behavior.
811
812   There is however, one perverse case that will expose a backwards
813   incompatibility.  If 1) you had a view that was registered as a
814   member of a multiview 2) this view explicitly raised a ``NotFound``
815   exception *in order to* proceed to the next predicate check in the
816   multiview, that code will now behave differently: rather than
817   skipping to the next view match, a NotFound will be raised to the
818   top-level exception handling machinery instead.  For code to be
819   depending upon the behavior of a view raising ``NotFound`` to
820   proceed to the next predicate match, would be tragic, but not
821   impossible, given that ``NotFound`` is a public interface.
822   ``repoze.bfg.exceptions.PredicateMismatch`` is not a public API and
823   cannot be depended upon by application code, so you should not
824   change your view code to raise ``PredicateMismatch``.  Instead, move
825   the logic which raised the ``NotFound`` exception in the view out
826   into a custom view predicate.
827
828 - If, when you run your application's unit test suite under BFG 1.3, a
829   ``KeyError`` naming a template or a ``ValueError`` indicating that a
830   'renderer factory' is not registered may is raised
831   (e.g. ``ValueError: No factory for renderer named '.pt' when looking
832   up karl.views:templates/snippets.pt``), you may need to perform some
833   extra setup in your test code.
834
835   The best solution is to use the
836   ``repoze.bfg.configuration.Configurator.testing_add_renderer`` (or,
837   alternately the deprecated
838   ``repoze.bfg.testing.registerTemplateRenderer`` or
839   ``registerDummyRenderer``) API within the code comprising each
840   individual unit test suite to register a "dummy" renderer for each
841   of the templates and renderers used by code under test.  For
842   example::
843
844     config = Configurator()
845     config.testing_add_renderer('karl.views:templates/snippets.pt')
846
847   This will register a basic dummy renderer for this particular
848   missing template.  The ``testing_add_renderer`` API actually
849   *returns* the renderer, but if you don't care about how the render
850   is used, you don't care about having a reference to it either.
851
852   A more rough way to solve the issue exists.  It causes the "real"
853   template implementations to be used while the system is under test,
854   which is suboptimal, because tests will run slower, and unit tests
855   won't actually *be* unit tests, but it is easier.  Always ensure you
856   call the ``setup_registry()`` method of the Configurator .  Eg::
857
858     reg = MyRegistry()
859     config = Configurator(registry=reg)
860     config.setup_registry()
861
862   Calling ``setup_registry`` only has an effect if you're *passing in*
863   a ``registry`` argument to the Configurator constructor.
864   ``setup_registry`` is called by the course of normal operations
865   anyway if you do not pass in a ``registry``.
866
867   If your test suite isn't using a Configurator yet, and is still
868   using the older ``repoze.bfg.testing`` APIs name ``setUp`` or
869   ``cleanUp``, these will register the renderers on your behalf.
870
871   A variant on the symptom for this theme exists: you may already be
872   dutifully registering a dummy template or renderer for a template
873   used by the code you're testing using ``testing_register_renderer``
874   or ``registerTemplateRenderer``, but (perhaps unbeknownst to you)
875   the code under test expects to be able to use a "real" template
876   renderer implementation to retrieve or render *another* template
877   that you forgot was being rendered as a side effect of calling the
878   code you're testing.  This happened to work because it found the
879   *real* template while the system was under test previously, and now
880   it cannot.  The solution is the same.
881
882   It may also help reduce confusion to use a *resource specification*
883   to specify the template path in the test suite and code rather than
884   a relative path in either.  A resource specification is unambiguous,
885   while a relative path needs to be relative to "here", where "here"
886   isn't always well-defined ("here" in a test suite may or may not be
887   the same as "here" in the code under test).
888
889 1.3a5 (2010-07-14)
890 ==================
891
892 Features
893 --------
894
895 - New internal exception: ``repoze.bfg.exceptions.URLDecodeError``.
896   This URL is a subclass of the built-in Python exception named
897   ``UnicodeDecodeError``.
898
899 - When decoding a URL segment to Unicode fails, the exception raised
900   is now ``repoze.bfg.exceptions.URLDecodeError`` instead of
901   ``UnicodeDecodeError``.  This makes it possible to register an
902   exception view invoked specifically when ``repoze.bfg`` cannot
903   decode a URL.
904
905 Bug Fixes
906 ---------
907
908 - Fix regression in
909   ``repoze.bfg.configuration.Configurator.add_static_view``.  Before
910   1.3a4, view names that contained a slash were supported as route
911   prefixes. 1.3a4 broke this by trying to treat them as full URLs.
912
913 Documentation
914 -------------
915
916 - The ``repoze.bfg.exceptions.URLDecodeError`` exception was added to
917   the exceptions chapter of the API documentation.
918
919 Backwards Incompatibilities
920 ----------------------------
921
922 - in previous releases, when a URL could not be decoded from UTF-8
923   during traversal, a ``TypeError`` was raised.  Now the error which
924   is raised is a ``repoze.bfg.exceptions.URLDecodeError``.
925
926 1.3a4 (2010-07-03)
927 ==================
928
929 Features
930 --------
931
932 - Undocumented hook: make ``get_app`` and ``get_root`` of the
933   ``repoze.bfg.paster.BFGShellCommand`` hookable in cases where
934   endware may interfere with the default versions.
935
936 - In earlier versions, a custom route predicate associated with a url
937   dispatch route (each of the predicate functions fed to the
938   ``custom_predicates`` argument of
939   ``repoze.bfg.configuration.Configurator.add_route``) has always
940   required a 2-positional argument signature, e.g. ``(context,
941   request)``.  Before this release, the ``context`` argument was
942   always ``None``.
943
944   As of this release, the first argument passed to a predicate is now
945   a dictionary conventionally named ``info`` consisting of ``route``,
946   and ``match``.  ``match`` is a dictionary: it represents the
947   arguments matched in the URL by the route.  ``route`` is an object
948   representing the route which was matched.
949
950   This is useful when predicates need access to the route match.  For
951   example::
952
953     def any_of(segment_name, *args):
954         def predicate(info, request):
955             if info['match'][segment_name] in args:
956                 return True
957         return predicate
958
959     num_one_two_or_three = any_of('num, 'one', 'two', 'three')
960
961     add_route('num', '/:num', custom_predicates=(num_one_two_or_three,))
962
963   The ``route`` object is an object that has two useful attributes:
964   ``name`` and ``path``.  The ``name`` attribute is the route name.
965   The ``path`` attribute is the route pattern.  An example of using
966   the route in a set of route predicates::
967
968     def twenty_ten(info, request):
969         if info['route'].name in ('ymd', 'ym', 'y'):
970             return info['match']['year'] == '2010'
971
972     add_route('y', '/:year', custom_predicates=(twenty_ten,))
973     add_route('ym', '/:year/:month', custom_predicates=(twenty_ten,))
974     add_route('ymd', '/:year/:month:/day', custom_predicates=(twenty_ten,))
975
976 - The ``repoze.bfg.url.route_url`` API has changed.  If a keyword
977   ``_app_url`` is present in the arguments passed to ``route_url``,
978   this value will be used as the protocol/hostname/port/leading path
979   prefix of the generated URL.  For example, using an ``_app_url`` of
980   ``http://example.com:8080/foo`` would cause the URL
981   ``http://example.com:8080/foo/fleeb/flub`` to be returned from this
982   function if the expansion of the route pattern associated with the
983   ``route_name`` expanded to ``/fleeb/flub``.
984
985 - It is now possible to use a URL as the ``name`` argument fed to
986   ``repoze.bfg.configuration.Configurator.add_static_view``.  When the
987   name argument is a URL, the ``repoze.bfg.url.static_url`` API will
988   generate join this URL (as a prefix) to a path including the static
989   file name.  This makes it more possible to put static media on a
990   separate webserver for production, while keeping static media
991   package-internal and served by the development webserver during
992   development.
993
994 Documentation
995 -------------
996
997 - The authorization chapter of the ZODB Wiki Tutorial
998   (docs/tutorials/bfgwiki) was changed to demonstrate authorization
999   via a group rather than via a direct username (thanks to Alex
1000   Marandon).
1001
1002 - The authorization chapter of the SQLAlchemy Wiki Tutorial
1003   (docs/tutorials/bfgwiki2) was changed to demonstrate authorization
1004   via a group rather than via a direct username.
1005
1006 - Redirect requests for tutorial sources to
1007   http://docs.repoze.org/bfgwiki-1.3 and
1008   http://docs.repoze.org/bfgwiki2-1.3/ respectively.
1009
1010 - A section named ``Custom Route Predicates`` was added to the URL
1011   Dispatch narrative chapter.
1012
1013 - The Static Resources chapter has been updated to mention using
1014   ``static_url`` to generate URLs to external webservers.
1015
1016 Internal
1017 --------
1018
1019 - Removed ``repoze.bfg.static.StaticURLFactory`` in favor of a new
1020   abstraction revolving around the (still-internal)
1021   ``repoze.bfg.static.StaticURLInfo`` helper class.
1022
1023 1.3a3 (2010-05-01)
1024 ==================
1025
1026 Paster Templates
1027 ----------------
1028
1029 - The ``bfg_alchemy`` and ``bfg_routesalchemy`` templates no longer
1030   register a ``handle_teardown`` event listener which calls
1031   ``DBSession.remove``.  This was found by Chris Withers to be
1032   unnecessary.
1033
1034 Documentation
1035 -------------
1036
1037 - The "bfgwiki2" (URL dispatch wiki) tutorial code and documentation
1038   was changed to remove the ``handle_teardown`` event listener which
1039   calls ``DBSession.remove``.
1040
1041 - Any mention of the ``handle_teardown`` event listener as used by the
1042   paster templates was removed from the URL Dispatch narrative chapter.
1043
1044 - A section entitled Detecting Available Languages was added to the
1045   i18n narrative docs chapter.
1046
1047 1.3a2 (2010-04-28)
1048 ==================
1049
1050 Features
1051 --------
1052
1053 - A locale negotiator no longer needs to be registered explicitly. The
1054   default locale negotiator at
1055   ``repoze.bfg.i18n.default_locale_negotiator`` is now used
1056   unconditionally as... um, the default locale negotiator.
1057
1058 - The default locale negotiator has become more complex.
1059
1060   * First, the negotiator looks for the ``_LOCALE_`` attribute of
1061     the request object (possibly set by a view or an event listener).
1062   
1063   * Then it looks for the ``request.params['_LOCALE_']`` value.
1064
1065   * Then it looks for the ``request.cookies['_LOCALE_']`` value.
1066
1067 Backwards Incompatibilities
1068 ---------------------------
1069
1070 - The default locale negotiator now looks for the parameter named
1071   ``_LOCALE_`` rather than a parameter named ``locale`` in
1072   ``request.params``.
1073
1074 Behavior Changes
1075 ----------------
1076
1077 - A locale negotiator may now return ``None``, signifying that the
1078   default locale should be used.
1079
1080 Documentation
1081 -------------
1082
1083 - Documentation concerning locale negotiation in the
1084   Internationalizationa and Localization chapter was updated.
1085
1086 - Expanded portion of i18n narrative chapter docs which discuss
1087   working with gettext files.
1088
1089 1.3a1 (2010-04-26)
1090 ==================
1091
1092 Features
1093 --------
1094
1095 - Added "exception views".  When you use an exception (anything that
1096   inherits from the Python ``Exception`` builtin) as view context
1097   argument, e.g.::
1098
1099       from repoze.bfg.view import bfg_view
1100       from repoze.bfg.exceptions import NotFound
1101       from webob.exc import HTTPNotFound
1102
1103       @bfg_view(context=NotFound)
1104       def notfound_view(request):
1105           return HTTPNotFound()
1106
1107   For the above example, when the ``repoze.bfg.exceptions.NotFound``
1108   exception is raised by any view or any root factory, the
1109   ``notfound_view`` view callable will be invoked and its response
1110   returned.
1111
1112   Other normal view predicates can also be used in combination with an
1113   exception view registration::
1114
1115       from repoze.bfg.view import bfg_view
1116       from repoze.bfg.exceptions import NotFound
1117       from webob.exc import HTTPNotFound
1118
1119       @bfg_view(context=NotFound, route_name='home')
1120       def notfound_view(request):
1121           return HTTPNotFound()
1122
1123   The above exception view names the ``route_name`` of ``home``,
1124   meaning that it will only be called when the route matched has a
1125   name of ``home``.  You can therefore have more than one exception
1126   view for any given exception in the system: the "most specific" one
1127   will be called when the set of request circumstances which match the
1128   view registration.  The only predicate that cannot be not be used
1129   successfully is ``name``.  The name used to look up an exception
1130   view is always the empty string.
1131
1132   Existing (pre-1.3) normal views registered against objects
1133   inheriting from ``Exception`` will continue to work.  Exception
1134   views used for user-defined exceptions and system exceptions used as
1135   contexts will also work.
1136
1137   The feature can be used with any view registration mechanism
1138   (``@bfg_view`` decorator, ZCML, or imperative ``config.add_view``
1139   styles).
1140
1141   This feature was kindly contributed by Andrey Popp.
1142
1143 - Use "Venusian" (`http://docs.repoze.org/venusian
1144   <http://docs.repoze.org/venusian>`_) to perform ``bfg_view``
1145   decorator scanning rather than relying on a BFG-internal decorator
1146   scanner.  (Truth be told, Venusian is really just a generalization
1147   of the BFG-internal decorator scanner).
1148
1149 - Internationalization and localization features as documented in the
1150   narrative documentation chapter entitled ``Internationalization and
1151   Localization``.
1152
1153 - A new deployment setting named ``default_locale_name`` was added.
1154   If this string is present as a Paster ``.ini`` file option, it will
1155   be considered the default locale name.  The default locale name is
1156   used during locale-related operations such as language translation.
1157
1158 - It is now possible to turn on Chameleon template "debugging mode"
1159   for all Chameleon BFG templates by setting a BFG-related Paster
1160   ``.ini`` file setting named ``debug_templates``. The exceptions
1161   raised by Chameleon templates when a rendering fails are sometimes
1162   less than helpful.  ``debug_templates`` allows you to configure your
1163   application development environment so that exceptions generated by
1164   Chameleon during template compilation and execution will contain
1165   more helpful debugging information.  This mode is on by default in
1166   all new projects.
1167
1168 - Add a new method of the Configurator named ``derive_view`` which can
1169   be used to generate a BFG view callable from a user-supplied
1170   function, instance, or class. This useful for external framework and
1171   plugin authors wishing to wrap callables supplied by their users
1172   which follow the same calling conventions and response conventions
1173   as objects that can be supplied directly to BFG as a view callable.
1174   See the ``derive_view`` method in the
1175   ``repoze.bfg.configuration.Configurator`` docs.
1176
1177 ZCML
1178 ----
1179
1180 - Add a ``translationdir`` ZCML directive to support localization.
1181
1182 - Add a ``localenegotiator`` ZCML directive to support localization.
1183
1184 Deprecations
1185 ------------
1186
1187 -  The exception views feature replaces the need for the
1188    ``set_notfound_view`` and ``set_forbidden_view`` methods of the
1189    ``Configurator`` as well as the ``notfound`` and ``forbidden`` ZCML
1190    directives.  Those methods and directives will continue to work for
1191    the foreseeable future, but they are deprecated in the
1192    documentation.
1193
1194 Dependencies
1195 ------------
1196
1197 - A new install-time dependency on the ``venusian`` distribution was
1198   added.
1199
1200 - A new install-time dependency on the ``translationstring``
1201   distribution was added.
1202
1203 - Chameleon 1.2.3 or better is now required (internationalization and
1204   per-template debug settings).
1205
1206 Internal
1207 --------
1208
1209 - View registrations and lookups are now done with three "requires"
1210   arguments instead of two to accomodate orthogonality of exception
1211   views.
1212
1213 - The ``repoze.bfg.interfaces.IForbiddenView`` and
1214   ``repoze.bfg.interfaces.INotFoundView`` interfaces were removed;
1215   they weren't APIs and they became vestigial with the addition of
1216   exception views.
1217
1218 - Remove ``repoze.bfg.compat.pkgutil_26.py`` and import alias
1219   ``repoze.bfg.compat.walk_packages``.  These were only required by
1220   internal scanning machinery; Venusian replaced the internal scanning
1221   machinery, so these are no longer required.
1222
1223 Documentation
1224 -------------
1225
1226 - Exception view documentation was added to the ``Hooks`` narrative
1227   chapter.
1228
1229 - A new narrative chapter entitled ``Internationalization and
1230   Localization`` was added.
1231
1232 - The "Environment Variables and ``ini`` File Settings" chapter was
1233   changed: documentation about the ``default_locale_name`` setting was
1234   added.
1235
1236 - A new API chapter for the ``repoze.bfg.i18n`` module was added.
1237
1238 - Documentation for the new ``translationdir`` and
1239   ``localenegotiator`` ZCML directives were added.
1240
1241 - A section was added to the Templates chapter entitled "Nicer
1242   Exceptions in Templates" describing the result of setting
1243   ``debug_templates = true``.
1244
1245 Paster Templates
1246 ----------------
1247
1248 - All paster templates now create a ``setup.cfg`` which includes
1249   commands related to nose testing and Babel message catalog
1250   extraction/compilation.
1251
1252 - A ``default_locale_name = en`` setting was added to each existing paster
1253   template.
1254
1255 - A ``debug_templates = true`` setting was added to each existing
1256   paster template.
1257
1258 Licensing
1259 ---------
1260
1261 - The Edgewall (BSD) license was added to the LICENSES.txt file, as
1262   some code in the ``repoze.bfg.i18n`` derives from Babel source.
1263
1264 1.2 (2010-02-10)
1265 ================
1266
1267 - No changes from 1.2b6.
1268
1269 1.2b6 (2010-02-06)
1270 ==================
1271
1272 Backwards Incompatibilities
1273 ---------------------------
1274
1275 - Remove magical feature of ``repoze.bfg.url.model_url`` which
1276   prepended a fully-expanded urldispatch route URL before a the
1277   model's path if it was noticed that the request had matched a route.
1278   This feature was ill-conceived, and didn't work in all scenarios.
1279
1280 Bug Fixes
1281 ---------
1282
1283 - More correct conversion of provided ``renderer`` values to resource
1284   specification values (internal).
1285
1286 1.2b5 (2010-02-04)
1287 ==================
1288
1289 Bug Fixes
1290 ---------
1291
1292 - 1.2b4 introduced a bug whereby views added via a route configuration
1293   that named a view callable and also a ``view_attr`` became broken.
1294   Symptom: ``MyViewClass is not callable`` or the ``__call__`` of a
1295   class was being called instead of the method named via
1296   ``view_attr``.
1297
1298 - Fix a bug whereby a ``renderer`` argument to the ``@bfg_view``
1299   decorator that provided a package-relative template filename might
1300   not have been resolved properly.  Symptom: inappropriate ``Missing
1301   template resource`` errors.
1302
1303 1.2b4 (2010-02-03)
1304 ==================
1305
1306 Documentation
1307 -------------
1308
1309 - Update GAE tutorial to use Chameleon instead of Jinja2 (now that
1310   it's possible).
1311
1312 Bug Fixes
1313 ---------
1314
1315 - Ensure that ``secure`` flag for AuthTktAuthenticationPolicy
1316   constructor does what it's documented to do (merge Daniel Holth's
1317   fancy-cookies-2 branch).
1318
1319 Features
1320 --------
1321
1322 - Add ``path`` and ``http_only`` options to
1323   AuthTktAuthenticationPolicy constructor (merge Daniel Holth's
1324   fancy-cookies-2 branch).
1325
1326 Backwards Incompatibilities
1327 ---------------------------
1328
1329 - Remove ``view_header``, ``view_accept``, ``view_xhr``,
1330   ``view_path_info``, ``view_request_method``, ``view_request_param``,
1331   and ``view_containment`` predicate arguments from the
1332   ``Configurator.add_route`` argument list.  These arguments were
1333   speculative.  If you need the features exposed by these arguments,
1334   add a view associated with a route using the ``route_name`` argument
1335   to the ``add_view`` method instead.
1336
1337 - Remove ``view_header``, ``view_accept``, ``view_xhr``,
1338   ``view_path_info``, ``view_request_method``, ``view_request_param``,
1339   and ``view_containment`` predicate arguments from the ``route`` ZCML
1340   directive attribute set.  These attributes were speculative.  If you
1341   need the features exposed by these attributes, add a view associated
1342   with a route using the ``route_name`` attribute of the ``view`` ZCML
1343   directive instead.
1344
1345 Dependencies
1346 ------------
1347
1348 - Remove dependency on ``sourcecodegen`` (not depended upon by
1349   Chameleon 1.1.1+).
1350
1351 1.2b3 (2010-01-24)
1352 ==================
1353
1354 Bug Fixes
1355 ---------
1356
1357 - When "hybrid mode" (both traversal and urldispatch) is in use,
1358   default to finding route-related views even if a non-route-related
1359   view registration has been made with a more specific context.  The
1360   default used to be to find views with a more specific context first.
1361   Use the new ``use_global_views`` argument to the route definition to
1362   get back the older behavior.
1363
1364 Features
1365 --------
1366
1367 - Add ``use_global_views`` argument to ``add_route`` method of
1368   Configurator.  When this argument is true, views registered for *no*
1369   route will be found if no more specific view related to the route is
1370   found.
1371
1372 - Add ``use_global_views`` attribute to ZCML ``<route>`` directive
1373   (see above).
1374
1375 Internal
1376 --------
1377
1378 - When registering a view, register the view adapter with the
1379   "requires" interfaces as ``(request_type, context_type)`` rather
1380   than ``(context_type, request_type)``.  This provides for saner
1381   lookup, because the registration will always be made with a specific
1382   request interface, but registration may not be made with a specific
1383   context interface.  In general, when creating multiadapters, you
08c221 1384   want to order the requires interfaces so that the elements which
b7c935 1385   are more likely to be registered using specific interfaces are
CM 1386   ordered before those which are less likely.
1387
1388 1.2b2 (2010-01-21)
1389 ==================
1390
1391 Bug Fixes
1392 ---------
1393
1394 - When the ``Configurator`` is passed an instance of
1395   ``zope.component.registry.Components`` as a ``registry`` constructor
1396   argument, fix the instance up to have the attributes we expect of an
1397   instance of ``repoze.bfg.registry.Registry`` when ``setup_registry``
1398   is called.  This makes it possible to use the global Zope component
1399   registry as a BFG application registry.
1400
1401 - When WebOb 0.9.7.1 was used, a deprecation warning was issued for
1402   the class attribute named ``charset`` within
1403   ``repoze.bfg.request.Request``.  BFG now *requires* WebOb >= 0.9.7,
1404   and code was added so that this deprecation warning has disappeared.
1405
1406 - Fix a view lookup ordering bug whereby a view with a larger number
1407   of predicates registered first (literally first, not "earlier") for
1408   a triad would lose during view lookup to one registered with fewer.
1409
1410 - Make sure views with exactly N custom predicates are always called
1411   before views with exactly N non-custom predicates given all else is
1412   equal in the view configuration.
1413
1414 Documentation
1415 -------------
1416
1417 - Change renderings of ZCML directive documentation.
1418
1419 - Add a narrative documentation chapter: "Using the Zope Component
1420   Architecture in repoze.bfg".
1421
1422 Dependencies
1423 ------------
1424
1425 - Require WebOb >= 0.9.7
1426
1427 1.2b1 (2010-01-18)
1428 ==================
1429
1430 Bug Fixes
1431 ---------
1432
1433 - In ``bfg_routesalchemy``, ``bfg_alchemy`` paster templates and the
1434   ``bfgwiki2`` tutorial, clean up the SQLAlchemy connection by
1435   registering a ``repoze.tm.after_end`` callback instead of relying on
1436   a ``__del__`` method of a ``Cleanup`` class added to the WSGI
1437   environment.  The ``__del__`` strategy was fragile and caused
1438   problems in the wild.  Thanks to Daniel Holth for testing.
1439
1440 Features
1441 --------
1442
1443 - Read logging configuration from PasteDeploy config file ``loggers``
1444   section (and related) when ``paster bfgshell`` is invoked.
1445
1446 Documentation
1447 -------------
1448
1449 - Major rework in preparation for book publication.
1450
1451 1.2a11 (2010-01-05)
1452 ===================
1453
1454 Bug Fixes
1455 ---------
1456
1457 - Make ``paster bfgshell`` and ``paster create -t bfg_xxx`` work on
1458   Jython (fix minor incompatibility with treatment of ``__doc__`` at
1459   the class level).
1460
1461 - Updated dependency on ``WebOb`` to require a version which supports
1462   features now used in tests.
1463
1464 Features
1465 --------
1466
1467 - Jython compatibility (at least when repoze.bfg.jinja2 is used as the
1468   templating engine; Chameleon does not work under Jython).
1469
1470 - Show the derived abspath of template resource specifications in the
1471   traceback when a renderer template cannot be found.
1472
1473 - Show the original traceback when a Chameleon template cannot be
1474   rendered due to a platform incompatibility.
1475
1476 1.2a10 (2010-01-04)
1477 ===================
1478
1479 Features
1480 --------
1481
1482 - The ``Configurator.add_view`` method now accepts an argument named
1483   ``context``.  This is an alias for the older argument named
1484   ``for_``; it is preferred over ``for_``, but ``for_`` will continue
1485   to be supported "forever".
1486
1487 - The ``view`` ZCML directive now accepts an attribute named
1488   ``context``.  This is an alias for the older attribute named
1489   ``for``; it is preferred over ``for``, but ``for`` will continue to
1490   be supported "forever".
1491
1492 - The ``Configurator.add_route`` method now accepts an argument named
1493   ``view_context``.  This is an alias for the older argument named
1494   ``view_for``; it is preferred over ``view_for``, but ``view_for``
1495   will continue to be supported "forever".
1496
1497 - The ``route`` ZCML directive now accepts an attribute named
1498   ``view_context``.  This is an alias for the older attribute named
1499   ``view_for``; it is preferred over ``view_for``, but ``view_for``
1500   will continue to be supported "forever".
1501
1502 Documentation and Paster Templates
1503 ----------------------------------
1504
1505 - LaTeX rendering tweaks.
1506
1507 - All uses of the ``Configurator.add_view`` method that used its
1508   ``for_`` argument now use the ``context`` argument instead.
1509
1510 - All uses of the ``Configurator.add_route`` method that used its
1511   ``view_for`` argument now use the ``view_context`` argument instead.
1512
1513 - All uses of the ``view`` ZCML directive that used its ``for``
1514   attribute now use the ``context`` attribute instead.
1515
1516 - All uses of the ``route`` ZCML directive that used its ``view_for``
1517   attribute now use the ``view_context`` attribute instead.
1518
1519 - Add a (minimal) tutorial dealing with use of ``repoze.catalog`` in a
1520   ``repoze.bfg`` application.
1521
1522 Documentation Licensing
1523 -----------------------
1524
1525 - Loosen the documentation licensing to allow derivative works: it is
1526   now offered under the `Creative Commons
1527   Attribution-Noncommercial-Share Alike 3.0 United States License
1528   <http://creativecommons.org/licenses/by-nc-sa/3.0/us/>`_.  This is
1529   only a documentation licensing change; the ``repoze.bfg`` software
1530   continues to be offered under the Repoze Public License at
1531   http://repoze.org/license.html (BSD-like).
1532
1533 1.2a9 (2009-12-27)
1534 ==================
1535
1536 Documentation Licensing
1537 -----------------------
1538
1539 - The *documentation* (the result of ``make <html|latex|htmlhelp>``
1540   within the ``docs`` directory) in this release is now offered under
1541   the Creative Commons Attribution-Noncommercial-No Derivative Works
1542   3.0 United States License as described by
1543   http://creativecommons.org/licenses/by-nc-nd/3.0/us/ .  This is only
1544   a licensing change for the documentation; the ``repoze.bfg``
1545   software continues to be offered under the Repoze Public License
1546   at http://repoze.org/license.html (BSD-like).
1547
1548 Documentation
1549 -------------
1550
1551 - Added manual index entries to generated index.
1552
1553 - Document the previously existing (but non-API)
1554   ``repoze.bfg.configuration.Configurator.setup_registry`` method as
1555   an official API of a ``Configurator``.
1556
1557 - Fix syntax errors in various documentation code blocks.
1558
1559 - Created new top-level documentation section: "ZCML Directives".
1560   This section contains detailed ZCML directive information, some of
1561   which was removed from various narrative chapters.
1562
1563 - The LaTeX rendering of the documentation has been improved.
1564
1565 - Added a "Fore-Matter" section with author, copyright, and licensing
1566   information.
1567
1568 1.2a8 (2009-12-24)
1569 ==================
1570
1571 Features
1572 --------
1573
1574 - Add a ``**kw`` arg to the ``Configurator.add_settings`` API.
1575
1576 - Add ``hook_zca`` and ``unhook_zca`` methods to the ``Configurator``
1577   API.
1578
1579 - The ``repoze.bfg.testing.setUp`` method now returns a
1580   ``Configurator`` instance which can be used to do further
1581   configuration during unit tests.
1582
1583 Bug Fixes
1584 ---------
1585
1586 - The ``json`` renderer failed to set the response content type to
1587   ``application/json``.  It now does, by setting
1588   ``request.response_content_type`` unless this attribute is already
1589   set.
1590
1591 - The ``string`` renderer failed to set the response content type to
1592   ``text/plain``.  It now does, by setting
1593   ``request.response_content_type`` unless this attribute is already
1594   set.
1595
1596 Documentation
1597 -------------
1598
1599 - General documentation improvements by using better Sphinx roles such
1600   as "class", "func", "meth", and so on.  This means that there are
1601   many more hyperlinks pointing to API documentation for API
1602   definitions in all narrative, tutorial, and API documentation
1603   elements.
1604
1605 - Added a description of imperative configuration in various places
1606   which only described ZCML configuration.
1607
1608 - A syntactical refreshing of various tutorials.
1609
1610 - Added the ``repoze.bfg.authentication``,
1611   ``repoze.bfg.authorization``, and ``repoze.bfg.interfaces`` modules
1612   to API documentation.
1613
1614 Deprecations
1615 ------------
1616
1617 - The ``repoze.bfg.testing.registerRoutesMapper`` API (added in an
1618   early 1.2 alpha) was deprecated.  Its import now generates a
1619   deprecation warning.
1620
1621 1.2a7 (2009-12-20)
1622 ==================
1623
1624 Features
1625 --------
1626
1627 - Add four new testing-related APIs to the
1628   ``repoze.bfg.configuration.Configurator`` class:
1629   ``testing_securitypolicy``, ``testing_models``,
1630   ``testing_add_subscriber``, and ``testing_add_template``.  These
1631   were added in order to provide more direct access to the
1632   functionality of the ``repoze.bfg.testing`` APIs named
1633   ``registerDummySecurityPolicy``, ``registerModels``,
1634   ``registerEventListener``, and ``registerTemplateRenderer`` when a
1635   configurator is used.  The ``testing`` APIs named are nominally
1636   deprecated (although they will likely remain around "forever", as
1637   they are in heavy use in the wild).
1638
1639 - Add a new API to the ``repoze.bfg.configuration.Configurator``
1640   class: ``add_settings``.  This API can be used to add "settings"
1641   (information returned within via the
1642   ``repoze.bfg.settings.get_settings`` API) after the configurator has
1643   been initially set up.  This is most useful for testing purposes.
1644
1645 - Add a ``custom_predicates`` argument to the ``Configurator``
1646   ``add_view`` method, the ``bfg_view`` decorator and the attribute
1647   list of the ZCML ``view`` directive.  If ``custom_predicates`` is
1648   specified, it must be a sequence of predicate callables (a predicate
1649   callable accepts two arguments: ``context`` and ``request`` and
1650   returns ``True`` or ``False``).  The associated view callable will
1651   only be invoked if all custom predicates return ``True``.  Use one
1652   or more custom predicates when no existing predefined predicate is
1653   useful.  Predefined and custom predicates can be mixed freely.
1654
1655 - Add a ``custom_predicates`` argument to the ``Configurator``
1656   ``add_route`` and the attribute list of the ZCML ``route``
1657   directive.  If ``custom_predicates`` is specified, it must be a
1658   sequence of predicate callables (a predicate callable accepts two
1659   arguments: ``context`` and ``request`` and returns ``True`` or
1660   ``False``).  The associated route will match will only be invoked if
1661   all custom predicates return ``True``, else route matching
1662   continues.  Note that the value ``context`` will always be ``None``
1663   when passed to a custom route predicate.  Use one or more custom
1664   predicates when no existing predefined predicate is useful.
1665   Predefined and custom predicates can be mixed freely.
1666
1667 Internal
1668 --------
1669
1670 - Remove the ``repoze.bfg.testing.registerTraverser`` function.  This
1671   function was never an API.
1672
1673 Documenation
1674 ------------
1675
1676 - Doc-deprecated most helper functions in the ``repoze.bfg.testing``
1677   module.  These helper functions likely won't be removed any time
1678   soon, nor will they generate a warning any time soon, due to their
1679   heavy use in the wild, but equivalent behavior exists in methods of
1680   a Configurator.
1681
1682 1.2a6 (2009-12-18)
1683 ==================
1684
1685 Features
1686 --------
1687
1688 - The ``Configurator`` object now has two new methods: ``begin`` and
1689   ``end``.  The ``begin`` method is meant to be called before any
1690   "configuration" begins (e.g. before ``add_view``, et. al are
1691   called).  The ``end`` method is meant to be called after all
1692   "configuration" is complete.
1693
1694   Previously, before there was imperative configuration at all (1.1
1695   and prior), configuration begin and end was invariably implied by
1696   the process of loading a ZCML file.  When a ZCML load happened, the
1697   threadlocal data structure containing the request and registry was
1698   modified before the load, and torn down after the load, making sure
1699   that all framework code that needed ``get_current_registry`` for the
1700   duration of the ZCML load was satisfied.
1701
1702   Some API methods called during imperative configuration, (such as
1703   ``Configurator.add_view`` when a renderer is involved) end up for
1704   historical reasons calling ``get_current_registry``.  However, in
1705   1.2a5 and below, the Configurator supplied no functionality that
1706   allowed people to make sure that ``get_current_registry`` returned
1707   the registry implied by the configurator being used.  ``begin`` now
1708   serves this purpose.  Inversely, ``end`` pops the thread local
1709   stack, undoing the actions of ``begin``.
1710
1711   We make this boundary explicit to reduce the potential for confusion
1712   when the configurator is used in different circumstances (e.g. in
1713   unit tests and app code vs. just in initial app setup).
1714
1715   Existing code written for 1.2a1-1.2a5 which does not call ``begin``
1716   or ``end`` continues to work in the same manner it did before.  It
1717   is however suggested that this code be changed to call ``begin`` and
1718   ``end`` to reduce the potential for confusion in the future.
1719
1720 - All ``paster`` templates which generate an application skeleton now
1721   make use of the new ``begin`` and ``end`` methods of the
1722   Configurator they use in their respective copies of ``run.py`` and
1723   ``tests.py``.
1724
1725 Documentation
1726 -------------
1727
1728 - All documentation that makes use of a ``Configurator`` object to do
1729   application setup and test setup now makes use of the new ``begin``
1730   and ``end`` methods of the configurator.
1731
1732 Bug Fixes
1733 ---------
1734
1735 - When a ``repoze.bfg.exceptions.NotFound`` or
1736   ``repoze.bfg.exceptions.Forbidden`` *class* (as opposed to instance)
1737   was raised as an exception within a root factory (or route root
1738   factory), the exception would not be caught properly by the
1739   ``repoze.bfg.`` Router and it would propagate to up the call stack,
1740   as opposed to rendering the not found view or the forbidden view as
1741   would have been expected.
1742
1743 - When Chameleon page or text templates used as renderers were added
1744   imperatively (via ``Configurator.add_view`` or some derivative),
1745   they too-eagerly attempted to look up the ``reload_templates``
1746   setting via ``get_settings``, meaning they were always registered in
1747   non-auto-reload-mode (the default).  Each now waits until its
1748   respective ``template`` attribute is accessed to look up the value.
1749
1750 - When a route with the same name as a previously registered route was
1751   added, the old route was not removed from the mapper's routelist.
1752   Symptom: the old registered route would be used (and possibly
1753   matched) during route lookup when it should not have had a chance to
1754   ever be used.
1755
1756 1.2a5 (2009-12-10)
1757 ==================
1758
1759 Features
1760 --------
1761
1762 - When the ``repoze.bfg.exceptions.NotFound`` or
1763   ``repoze.bfg.exceptions.Forbidden`` error is raised from within a
1764   custom root factory or the ``factory`` of a route, the appropriate
1765   response is now sent to the requesting user agent (the result of the
1766   notfound view or the forbidden view, respectively).  When these
1767   errors are raised from within a root factory, the ``context`` passed
1768   to the notfound or forbidden view will be ``None``.  Also, the
1769   request will not be decorated with ``view_name``, ``subpath``,
1770   ``context``, etc. as would normally be the case if traversal had
1771   been allowed to take place.
1772
1773 Internals
1774 ---------
1775
1776 - The exception class representing the error raised by various methods
1777   of a ``Configurator`` is now importable as
1778   ``repoze.bfg.exceptions.ConfigurationError``.
1779
1780 Documentation
1781 -------------
1782
1783 - General documentation freshening which takes imperative
1784   configuration into account in more places and uses glossary
1785   references more liberally.
1786
1787 - Remove explanation of changing the request type in a new request
1788   event subscriber, as other predicates are now usually an easier way
1789   to get this done.
1790
1791 - Added "Thread Locals" narrative chapter to documentation, and added
1792   a API chapter documenting the ``repoze.bfg.threadlocals`` module.
1793
1794 - Added a "Special Exceptions" section to the "Views" narrative
1795   documentation chapter explaining the effect of raising
1796   ``repoze.bfg.exceptions.NotFound`` and
1797   ``repoze.bfg.exceptions.Forbidden`` from within view code.
1798
1799 Dependencies
1800 ------------
1801
1802 - A new dependency on the ``twill`` package was added to the
1803   ``setup.py`` ``tests_require`` argument (Twill will only be
1804   downloaded when ``repoze.bfg`` ``setup.py test`` or ``setup.py
1805   nosetests`` is invoked).
1806
1807 1.2a4 (2009-12-07)
1808 ==================
1809
1810 Features
1811 --------
1812
1813 - ``repoze.bfg.testing.DummyModel`` now accepts a new constructor
1814   keyword argument: ``__provides__``.  If this constructor argument is
1815   provided, it should be an interface or a tuple of interfaces.  The
1816   resulting model will then provide these interfaces (they will be
1817   attached to the constructed model via
1818   ``zope.interface.alsoProvides``).
1819
1820 Bug Fixes
1821 ---------
1822
1823 - Operation on GAE was broken, presumably because the
1824   ``repoze.bfg.configuration`` module began to attempt to import the
1825   ``repoze.bfg.chameleon_zpt`` and ``repoze.bfg.chameleon_text``
1826   modules, and these cannot be used on non-CPython platforms.  It now
1827   tolerates startup time import failures for these modules, and only
1828   raise an import error when a template from one of these packages is
1829   actually used.
1830
1831 1.2a3 (2009-12-02)
1832 ==================
1833
1834 Bug Fixes
1835 ---------
1836
1837 - The ``repoze.bfg.url.route_url`` function inappropriately passed
1838   along ``_query`` and/or ``_anchor`` arguments to the
1839   ``mapper.generate`` function, resulting in blowups.
1840
1841 - When two views were registered with differering ``for`` interfaces
1842   or classes, and the ``for`` of first view registered was a
1843   superclass of the second, the ``repoze.bfg`` view machinery would
1844   incorrectly associate the two views with the same "multiview".
1845   Multiviews are meant to be collections of views that have *exactly*
1846   the same for/request/viewname values, without taking inheritance
1847   into account.  Symptom: wrong view callable found even when you had
1848   correctly specified a ``for_`` interface/class during view
1849   configuration for one or both view configurations.
1850
1851 Backwards Incompatibilities
1852 ---------------------------
1853
1854 - The ``repoze.bfg.templating`` module has been removed; it had been
1855   deprecated in 1.1 and never actually had any APIs in it.
1856
1857 1.2a2 (2009-11-29)
1858 ==================
1859
1860 Bug Fixes
1861 ---------
1862
08c221 1863 - The long description of this package (as shown on PyPI) was not
b7c935 1864   valid reStructuredText, and so was not renderable.
CM 1865
1866 - Trying to use an HTTP method name string such as ``GET`` as a
1867   ``request_type`` predicate argument caused a startup time failure
1868   when it was encountered in imperative configuration or in a
1869   decorator (symptom: ``Type Error: Required specification must be a
1870   specification``).  This now works again, although ``request_method``
1871   is now the preferred predicate argument for associating a view
1872   configuration with an HTTP request method.
1873
1874 Documentation
1875 -------------
1876
1877 - Fixed "Startup" narrative documentation chapter; it was explaining
1878   "the old way" an application constructor worked.
1879
1880 1.2a1 (2009-11-28)
1881 ==================
1882
1883 Features
1884 --------
1885
1886 - An imperative configuration mode.
1887
1888   A ``repoze.bfg`` application can now begin its life as a single
1889   Python file.  Later, the application might evolve into a set of
1890   Python files in a package.  Even later, it might start making use of
1891   other configuration features, such as ``ZCML``.  But neither the use
1892   of a package nor the use of non-imperative configuration is required
1893   to create a simple ``repoze.bfg`` application any longer.
1894
1895   Imperative configuration makes ``repoze.bfg`` competetive with
1896   "microframeworks" such as `Bottle <http://bottle.paws.de/>`_ and
1897   `Tornado <http://www.tornadoweb.org/>`_.  ``repoze.bfg`` has a good
1898   deal of functionality that most microframeworks lack, so this is
1899   hopefully a "best of both worlds" feature.
1900
1901   The simplest possible ``repoze.bfg`` application is now::
1902
1903      from webob import Response
1904      from wsgiref import simple_server
1905      from repoze.bfg.configuration import Configurator
1906
1907      def hello_world(request):
1908          return Response('Hello world!')
1909
1910      if __name__ == '__main__':
1911          config = Configurator()
1912          config.add_view(hello_world)
1913          app = config.make_wsgi_app()
1914          simple_server.make_server('', 8080, app).serve_forever()
1915
1916 - A new class now exists: ``repoze.bfg.configuration.Configurator``.
1917   This class forms the basis for sharing machinery between
1918   "imperatively" configured applications and traditional
1919   declaratively-configured applications.
1920
1921 - The ``repoze.bfg.testing.setUp`` function now accepts three extra
1922   optional keyword arguments: ``registry``, ``request`` and
1923   ``hook_zca``.
1924
1925   If the ``registry`` argument is not ``None``, the argument will be
1926   treated as the registry that is set as the "current registry" (it
1927   will be returned by ``repoze.bfg.threadlocal.get_current_registry``)
1928   for the duration of the test.  If the ``registry`` argument is
1929   ``None`` (the default), a new registry is created and used for the
1930   duration of the test.
1931
1932   The value of the ``request`` argument is used as the "current
1933   request" (it will be returned by
1934   ``repoze.bfg.threadlocal.get_current_request``) for the duration of
1935   the test; it defaults to ``None``.
1936
1937   If ``hook_zca`` is ``True`` (the default), the
1938   ``zope.component.getSiteManager`` function will be hooked with a
1939   function that returns the value of ``registry`` (or the
1940   default-created registry if ``registry`` is ``None``) instead of the
1941   registry returned by ``zope.component.getGlobalSiteManager``,
1942   causing the Zope Component Architecture API (``getSiteManager``,
1943   ``getAdapter``, ``getUtility``, and so on) to use the testing
1944   registry instead of the global ZCA registry.
1945
1946 - The ``repoze.bfg.testing.tearDown`` function now accepts an
1947   ``unhook_zca`` argument.  If this argument is ``True`` (the
1948   default), ``zope.component.getSiteManager.reset()`` will be called.
1949   This will cause the result of the ``zope.component.getSiteManager``
1950   function to be the global ZCA registry (the result of
1951   ``zope.component.getGlobalSiteManager``) once again.
1952
1953 - The ``run.py`` module in various ``repoze.bfg`` ``paster`` templates
1954   now use a ``repoze.bfg.configuration.Configurator`` class instead of
1955   the (now-legacy) ``repoze.bfg.router.make_app`` function to produce
1956   a WSGI application.
1957
1958 Documentation
1959 -------------
1960
1961 - The documentation now uses the "request-only" view calling
1962   convention in most examples (as opposed to the ``context, request``
1963   convention).  This is a documentation-only change; the ``context,
1964   request`` convention is also supported and documented, and will be
1965   "forever".
1966
1967 - ``repoze.bfg.configuration`` API documentation has been added.
1968
1969 - A narrative documentation chapter entitled "Creating Your First
1970   ``repoze.bfg`` Application" has been added.  This chapter details
1971   usage of the new ``repoze.bfg.configuration.Configurator`` class,
1972   and demonstrates a simplified "imperative-mode" configuration; doing
1973   ``repoze.bfg`` application configuration imperatively was previously
1974   much more difficult.
1975
1976 - A narrative documentation chapter entitled "Configuration,
1977   Decorations and Code Scanning" explaining ZCML- vs. imperative-
1978   vs. decorator-based configuration equivalence.
1979
1980 - The "ZCML Hooks" chapter has been renamed to "Hooks"; it documents
1981   how to override hooks now via imperative configuration and ZCML.
1982
1983 - The explanation about how to supply an alternate "response factory"
1984   has been removed from the "Hooks" chapter.  This feature may be
1985   removed in a later release (it still works now, it's just not
1986   documented).
1987
1988 - Add a section entitled "Test Set Up and Tear Down" to the
1989   unittesting chapter.
1990
1991 Bug Fixes
1992 ----------
1993
1994 - The ACL authorization policy debugging output when
1995   ``debug_authorization`` console debugging output was turned on
1996   wasn't as clear as it could have been when a view execution was
1997   denied due to an authorization failure resulting from the set of
1998   principals passed never having matched any ACE in any ACL in the
1999   lineage.  Now in this case, we report ``<default deny>`` as the ACE
2000   value and either the root ACL or ``<No ACL found on any object in
2001   model lineage>`` if no ACL was found.
2002
2003 - When two views were registered with the same ``accept`` argument,
2004   but were otherwise registered with the same arguments, if a request
2005   entered the application which had an ``Accept`` header that accepted
2006   *either* of the media types defined by the set of views registered
2007   with predicates that otherwise matched, a more or less "random" one
2008   view would "win".  Now, we try harder to use the view callable
2009   associated with the view configuration that has the most specific
2010   ``accept`` argument.  Thanks to Alberto Valverde for an initial
2011   patch.
2012
2013 Internals
2014 ---------
2015
2016 - The routes mapper is no longer a root factory wrapper.  It is now
2017   consulted directly by the router.
2018
2019 - The ``repoze.bfg.registry.make_registry`` callable has been removed.
2020
2021 - The ``repoze.bfg.view.map_view`` callable has been removed.
2022
2023 - The ``repoze.bfg.view.owrap_view`` callable has been removed.
2024
2025 - The ``repoze.bfg.view.predicate_wrap`` callable has been removed.
2026
2027 - The ``repoze.bfg.view.secure_view`` callable has been removed.
2028
2029 - The ``repoze.bfg.view.authdebug_view`` callable has been removed.
2030
2031 - The ``repoze.bfg.view.renderer_from_name`` callable has been
2032   removed.  Use ``repoze.bfg.configuration.Configurator.renderer_from_name``
2033   instead (still not an API, however).
2034
2035 - The ``repoze.bfg.view.derive_view`` callable has been removed.  Use
2036   ``repoze.bfg.configuration.Configurator.derive_view`` instead (still
2037   not an API, however).
2038
2039 - The ``repoze.bfg.settings.get_options`` callable has been removed.
2040   Its job has been subsumed by the ``repoze.bfg.settings.Settings``
2041   class constructor.
2042
2043 - The ``repoze.bfg.view.requestonly`` function has been moved to
2044   ``repoze.bfg.configuration.requestonly``.
2045
2046 - The ``repoze.bfg.view.rendered_response`` function has been moved to
2047   ``repoze.bfg.configuration.rendered_response``.
2048
2049 - The ``repoze.bfg.view.decorate_view`` function has been moved to
2050   ``repoze.bfg.configuration.decorate_view``.
2051
2052 - The ``repoze.bfg.view.MultiView`` class has been moved to
2053   ``repoze.bfg.configuration.MultiView``.
2054
2055 - The ``repoze.bfg.zcml.Uncacheable`` class has been removed.
2056
2057 - The ``repoze.bfg.resource.resource_spec`` function has been removed.
2058
2059 - All ZCML directives which deal with attributes which are paths now
2060   use the ``path`` method of the ZCML context to resolve a relative
2061   name to an absolute one (imperative configuration requirement).
2062
2063 - The ``repoze.bfg.scripting.get_root`` API now uses a 'real' WebOb
2064   request rather than a FakeRequest when it sets up the request as a
2065   threadlocal.
2066
2067 - The ``repoze.bfg.traversal.traverse`` API now uses a 'real' WebOb
2068   request rather than a FakeRequest when it calls the traverser.
2069
2070 - The ``repoze.bfg.request.FakeRequest`` class has been removed.
2071
2072 - Most uses of the ZCA threadlocal API (the ``getSiteManager``,
2073   ``getUtility``, ``getAdapter``, ``getMultiAdapter`` threadlocal API)
2074   have been removed from the core.  Instead, when a threadlocal is
2075   necessary, the core uses the
2076   ``repoze.bfg.threadlocal.get_current_registry`` API to obtain the
2077   registry.
2078
2079 - The internal ILogger utility named ``repoze.bfg.debug`` is now just
2080   an IDebugLogger unnamed utility.  A named utility with the old name
2081   is registered for b/w compat.
2082
2083 - The ``repoze.bfg.interfaces.ITemplateRendererFactory`` interface was
2084   removed; it has become unused.
2085
2086 - Instead of depending on the ``martian`` package to do code scanning,
2087   we now just use our own scanning routines.
2088
2089 - We now no longer have a dependency on ``repoze.zcml`` package;
2090   instead, the ``repoze.bfg`` package includes implementations of the
2091   ``adapter``, ``subscriber`` and ``utility`` directives.
2092
2093 - Relating to the following functions:
2094
2095   ``repoze.bfg.view.render_view``
2096
2097   ``repoze.bfg.view.render_view_to_iterable``
2098
2099   ``repoze.bfg.view.render_view_to_response``
2100
2101   ``repoze.bfg.view.append_slash_notfound_view``
2102
2103   ``repoze.bfg.view.default_notfound_view``
2104
2105   ``repoze.bfg.view.default_forbidden_view``
2106
2107   ``repoze.bfg.configuration.rendered_response``
2108
2109   ``repoze.bfg.security.has_permission``
2110
2111   ``repoze.bfg.security.authenticated_userid``
2112
2113   ``repoze.bfg.security.effective_principals``
2114
2115   ``repoze.bfg.security.view_execution_permitted``
2116
2117   ``repoze.bfg.security.remember``
2118
2119   ``repoze.bfg.security.forget``
2120
2121   ``repoze.bfg.url.route_url``
2122
2123   ``repoze.bfg.url.model_url``
2124
2125   ``repoze.bfg.url.static_url``
2126
2127   ``repoze.bfg.traversal.virtual_root``
2128
2129   Each of these functions now expects to be called with a request
2130   object that has a ``registry`` attribute which represents the
2131   current ``repoze.bfg`` registry.  They fall back to obtaining the
2132   registry from the threadlocal API.
2133
2134 Backwards Incompatibilites
2135 --------------------------
2136
2137 - Unit tests which use ``zope.testing.cleanup.cleanUp`` for the
2138   purpose of isolating tests from one another may now begin to fail
2139   due to lack of isolation between tests.
2140
2141   Here's why: In repoze.bfg 1.1 and prior, the registry returned by
2142   ``repoze.bfg.threadlocal.get_current_registry`` when no other
2143   registry had been pushed on to the threadlocal stack was the
2144   ``zope.component.globalregistry.base`` global registry (aka the
2145   result of ``zope.component.getGlobalSiteManager()``).  In repoze.bfg
2146   1.2+, however, the registry returned in this situation is the new
2147   module-scope ``repoze.bfg.registry.global_registry`` object.  The
2148   ``zope.testing.cleanup.cleanUp`` function clears the
2149   ``zope.component.globalregistry.base`` global registry
2150   unconditionally.  However, it does not know about the
2151   ``repoze.bfg.registry.global_registry`` object, so it does not clear
2152   it.
2153
2154   If you use the ``zope.testing.cleanup.cleanUp`` function in the
2155   ``setUp`` of test cases in your unit test suite instead of using the
2156   (more correct as of 1.1) ``repoze.bfg.testing.setUp``, you will need
2157   to replace all calls to ``zope.testing.cleanup.cleanUp`` with a call
2158   to ``repoze.bfg.testing.setUp``.
2159
2160   If replacing all calls to ``zope.testing.cleanup.cleanUp`` with a
2161   call to ``repoze.bfg.testing.setUp`` is infeasible, you can put this
2162   bit of code somewhere that is executed exactly **once** (*not* for
2163   each test in a test suite; in the `` __init__.py`` of your package
2164   or your package's ``tests`` subpackage would be a reasonable
2165   place)::
2166
2167     import zope.testing.cleanup
2168     from repoze.bfg.testing import setUp
2169     zope.testing.cleanup.addCleanUp(setUp)
2170
2171 - When there is no "current registry" in the
2172   ``repoze.bfg.threadlocal.manager`` threadlocal data structure (this
2173   is the case when there is no "current request" or we're not in the
2174   midst of a ``r.b.testing.setUp``-bounded unit test), the ``.get``
2175   method of the manager returns a data structure containing a *global*
2176   registry.  In previous releases, this function returned the global
2177   Zope "base" registry: the result of
2178   ``zope.component.getGlobalSiteManager``, which is an instance of the
2179   ``zope.component.registry.Component`` class.  In this release,
2180   however, the global registry returns a globally importable instance
2181   of the ``repoze.bfg.registry.Registry`` class.  This registry
2182   instance can always be imported as
2183   ``repoze.bfg.registry.global_registry``.
2184
2185   Effectively, this means that when you call
2186   ``repoze.bfg.threadlocal.get_current_registry`` when no request or
2187   ``setUp`` bounded unit test is in effect, you will always get back
2188   the global registry that lives in
2189   ``repoze.bfg.registry.global_registry``.  It also means that
2190   ``repoze.bfg`` APIs that *call* ``get_current_registry`` will use
2191   this registry.
2192
2193   This change was made because ``repoze.bfg`` now expects the registry
2194   it uses to have a slightly different API than a bare instance of
2195   ``zope.component.registry.Components``.
2196
2197 - View registration no longer registers a
2198   ``repoze.bfg.interfaces.IViewPermission`` adapter (it is no longer
2199   checked by the framework; since 1.1, views have been responsible for
2200   providing their own security).
2201
2202 - The ``repoze.bfg.router.make_app`` callable no longer accepts the
2203   ``authentication_policy`` nor the ``authorization_policy``
2204   arguments.  This feature was deprecated in version 1.0 and has been
2205   removed.
2206
2207 - Obscure: the machinery which configured views with a
2208   ``request_type`` *and* a ``route_name`` would ignore the request
2209   interface implied by ``route_name`` registering a view only for the
2210   interface implied by ``request_type``.  In the unlikely event that
2211   you were trying to use these two features together, the symptom
2212   would have been that views that named a ``request_type`` but which
2213   were also associated with routes were not found when the route
2214   matched.  Now if a view is configured with both a ``request_type``
2215   and a ``route_name``, an error is raised.
2216
2217 - The ``route`` ZCML directive now no longer accepts the
2218   ``request_type`` or ``view_request_type`` attributes.  These
2219   attributes didn't actually work in any useful way (see entry above
2220   this one).
2221
2222 - Because the ``repoze.bfg`` package now includes implementations of
2223   the ``adapter``, ``subscriber`` and ``utility`` ZCML directives, it
2224   is now an error to have ``<include package="repoze.zcml"
2225   file="meta.zcml"/>`` in the ZCML of a ``repoze.bfg`` application.  A
2226   ZCML conflict error will be raised if your ZCML does so.  This
2227   shouldn't be an issue for "normal" installations; it has always been
2228   the responsibility of the ``repoze.bfg.includes`` ZCML to include
2229   this file in the past; it now just doesn't.
2230
2231 - The ``repoze.bfg.testing.zcml_configure`` API was removed.  Use
2232   the ``Configurator.load_zcml`` API instead.
2233
2234 Deprecations
2235 ------------
2236
2237 - The ``repoze.bfg.router.make_app`` function is now nominally
2238   deprecated.  Its import and usage does not throw a warning, nor will
2239   it probably ever disappear.  However, using a
2240   ``repoze.bfg.configuration.Configurator`` class is now the preferred
2241   way to generate a WSGI application.
2242
2243   Note that ``make_app`` calls
2244   ``zope.component.getSiteManager.sethook(
2245   repoze.bfg.threadlocal.get_current_registry)`` on the caller's
2246   behalf, hooking ZCA global API lookups, for backwards compatibility
2247   purposes.  If you disuse ``make_app``, your calling code will need
2248   to perform this call itself, at least if your application uses the
2249   ZCA global API (``getSiteManager``, ``getAdapter``, etc).
2250
2251 Dependencies
2252 ------------
2253
2254 - A dependency on the ``martian`` package has been removed (its
2255   functionality is replaced internally).
2256
2257 - A dependency on the ``repoze.zcml`` package has been removed (its
2258   functionality is replaced internally).
2259
2260 1.1.1 (2009-11-21)
2261 ==================
2262
2263 Bug Fixes
2264 ---------
2265
2266 - "Hybrid mode" applications (applications which explicitly used
2267   traversal *after* url dispatch via ``<route>`` paths containing the
2268   ``*traverse`` element) were broken in 1.1-final and all 1.1 alpha
2269   and beta releases.  Views registered without a ``route_name`` route
2270   shadowed views registered with a ``route_name`` inappropriately.
2271
2272 1.1 (2009-11-15)
2273 ================
2274
2275 Internals
2276 ---------
2277
2278 - Remove dead IRouteRequirement interface from ``repoze.bfg.zcml``
2279   module.
2280
2281 Documentation
2282 -------------
2283
2284 - Improve the "Extending an Existing Application" narrative chapter.
2285
2286 - Add more sections to the "Defending Design" chapter.
2287
2288 1.1b4 (2009-11-12)
2289 ==================
2290
2291 Bug Fixes
2292 ---------
2293
2294 - Use ``alsoProvides`` in the urldispatch module to attach an
2295   interface to the request rather than ``directlyProvides`` to avoid
2296   disturbing interfaces set in a NewRequest event handler.
2297
2298 Documentation
2299 -------------
2300
2301 - Move 1.0.1 and previous changelog to HISTORY.txt.
2302
2303 - Add examples to ``repoze.bfg.url.model_url`` docstring.
2304
2305 - Add "Defending BFG Design" chapter to frontpage docs.
2306
2307 Templates
2308 ---------
2309
2310 - Remove ``ez_setup.py`` and its import from all paster templates,
2311   samples, and tutorials for ``distribute`` compatibility.  The
2312   documentation already explains how to install virtualenv (which will
2313   include some ``setuptools`` package), so these files, imports and
2314   usages were superfluous.
2315
2316 Deprecations
2317 ------------
2318
2319 - The ``options`` kw arg to the ``repoze.bfg.router.make_app``
2320   function is deprecated.  In its place is the keyword argument
2321   ``settings``.  The ``options`` keyword continues to work, and a
2322   deprecation warning is not emitted when it is detected.  However,
2323   the paster templates, code samples, and documentation now make
2324   reference to ``settings`` rather than ``options``.  This
2325   change/deprecation was mainly made for purposes of clarity and
2326   symmetry with the ``get_settings()`` API and dicussions of
2327   "settings" in various places in the docs: we want to use the same
2328   name to refer to the same thing everywhere.
2329
2330 1.1b3 (2009-11-06)
2331 ==================
2332
2333 Features
2334 --------
2335
2336 - ``repoze.bfg.testing.registerRoutesMapper`` testing facility added.
2337   This testing function registers a routes "mapper" object in the
2338   registry, for tests which require its presence.  This function is
2339   documented in the ``repoze.bfg.testing`` API documentation.
2340
2341 Bug Fixes
2342 ---------
2343
2344 - Compound statements that used an assignment entered into in an
2345   interactive IPython session invoked via ``paster bfgshell`` no
2346   longer fail to mutate the shell namespace correctly.  For example,
2347   this set of statements used to fail::
2348
2349     In [2]: def bar(x): return x
2350       ...:
2351     In [3]: list(bar(x) for x in 'abc')
2352     Out[3]: NameError: 'bar'
2353
2354   In this release, the ``bar`` function is found and the correct
2355   output is now sent to the console.  Thanks to Daniel Holth for the
2356   patch.
2357
2358 - The ``bfgshell`` command did not function properly; it was still
2359   expecting to be able to call the root factory with a bare
2360   ``environ`` rather than a request object.
2361
2362 Backwards Incompatibilities
2363 ---------------------------
2364
2365 - The ``repoze.bfg.scripting.get_root`` function now expects a
2366   ``request`` object as its second argument rather than an
2367   ``environ``.
2368
2369 1.1b2 (2009-11-02)
2370 ==================
2371
2372 Bug Fixes
2373 ---------
2374
2375 - Prevent PyPI installation failure due to ``easy_install`` trying way
2376   too hard to guess the best version of Paste.  When ``easy_install``
2377   pulls from PyPI it reads links off various pages to determine "more
2378   up to date" versions. It incorrectly picks up a link for an ancient
2379   version of a package named "Paste-Deploy-0.1" (note the dash) when
2380   trying to find the "Paste" distribution and somehow believes it's
2381   the latest version of "Paste".  It also somehow "helpfully" decides
2382   to check out a version of this package from SVN.  We pin the Paste
2383   dependency version to a version greater than 1.7 to work around
2384   this ``easy_install`` bug.
2385
2386 Documentation
2387 -------------
2388
2389 - Fix "Hybrid" narrative chapter: stop claiming that ``<view>``
2390   statements that mention a route_name need to come afer (in XML
2391   order) the ``<route>`` statement which creates the route.  This
2392   hasn't been true since 1.1a1.
2393
2394 - "What's New in ``repoze.bfg`` 1.1" document added to narrative
2395   documentation.
2396
2397 Features
2398 --------
2399
2400 - Add a new event type: ``repoze.bfg.events.AfterTraversal``.  Events
2401   of this type will be sent after traversal is completed, but before
2402   any view code is invoked.  Like ``repoze.bfg.events.NewRequest``,
2403   This event will have a single attribute: ``request`` representing
2404   the current request.  Unlike the request attribute of
2405   ``repoze.bfg.events.NewRequest`` however, during an AfterTraversal
2406   event, the request object will possess attributes set by the
2407   traverser, most notably ``context``, which will be the context used
2408   when a view is found and invoked.  The interface
2409   ``repoze.bfg.events.IAfterTraversal`` can be used to subscribe to
2410   the event.  For example::
2411
2412     <subscriber for="repoze.bfg.interfaces.IAfterTraversal"
2413                 handler="my.app.handle_after_traverse"/>
2414
2415   Like any framework event, a subscriber function should expect one
2416   parameter: ``event``.
2417
2418 Dependencies
2419 ------------
2420
2421 - Rather than depending on ``chameleon.core`` and ``chameleon.zpt``
2422   distributions individually, depend on Malthe's repackaged
2423   ``Chameleon`` distribution (which includes both ``chameleon.core``
2424   and ``chameleon.zpt``).
2425
2426 1.1b1 (2009-11-01)
2427 ==================
2428
2429 Bug Fixes
2430 ---------
2431
2432 - The routes root factory called route factories and the default route
2433   factory with an environ rather than a request.  One of the symptoms
2434   of this bug: applications generated using the ``bfg_zodb`` paster
2435   template in 1.1a9 did not work properly.
2436
2437 - Reinstate ``renderer`` alias for ``view_renderer`` in the
2438   ``<route>`` ZCML directive (in-the-wild 1.1a bw compat).
2439
2440 - ``bfg_routesalchemy`` paster template: change ``<route>``
2441   declarations: rename ``renderer`` attribute to ``view_renderer``.
2442
2443 - Header values returned by the ``authtktauthenticationpolicy``
2444   ``remember`` and ``forget`` methods would be of type ``unicode``.
2445   This violated the WSGI spec, causing a ``TypeError`` to be raised
2446   when these headers were used under ``mod_wsgi``.
2447
2448 - If a BFG app that had a route matching the root URL was mounted
2449   under a path in modwsgi, ala ``WSGIScriptAlias /myapp
2450   /Users/chrism/projects/modwsgi/env/bfg.wsgi``, the home route (a
2451   route with the path of ``'/'`` or ``''``) would not match when the
2452   path ``/myapp`` was visited (only when the path ``/myapp/`` was
2453   visited).  This is now fixed: if the urldispatch root factory notes
2454   that the PATH_INFO is empty, it converts it to a single slash before
2455   trying to do matching.
2456
2457 Documentation
2458 -------------
2459
2460 - In ``<route>`` declarations in tutorial ZCML, rename ``renderer``
2461   attribute to ``view_renderer`` (fwd compat).
2462
2463 - Fix various tutorials broken by 1.1a9 ``<route>`` directive changes.
2464
2465 Internal
2466 --------
2467
2468 - Deal with a potential circref in the traversal module.
2469
2470 1.1a9 (2009-10-31)
2471 ==================
2472
2473 Bug Fixes
2474 ---------
2475
2476 - An incorrect ZCML conflict would be encountered when the
2477   ``request_param`` predicate attribute was used on the ZCML ``view``
2478   directive if any two otherwise same-predicated views had the
2479   combination of a predicate value with an ``=`` sign and one without
2480   (e.g. ``a`` vs. ``a=123``).
2481
2482 Features
2483 --------
2484
2485 - In previous versions of BFG, the "root factory" (the ``get_root``
2486   callable passed to ``make_app`` or a function pointed to by the
2487   ``factory`` attribute of a route) was called with a "bare" WSGI
2488   environment.  In this version, and going forward, it will be called
2489   with a ``request`` object.  The request object passed to the factory
2490   implements dictionary-like methods in such a way that existing root
2491   factory code which expects to be passed an environ will continue to
2492   work.
2493
2494 - The ``__call__`` of a plugin "traverser" implementation (registered
2495   as an adapter for ``ITraverser`` or ``ITraverserFactory``) will now
2496   receive a *request* as the single argument to its ``__call__``
2497   method.  In previous versions it was passed a WSGI ``environ``
2498   object.  The request object passed to the factory implements
2499   dictionary-like methods in such a way that existing traverser code
2500   which expects to be passed an environ will continue to work.
2501
2502 - The ZCML ``route`` directive's attributes ``xhr``,
2503   ``request_method``, ``path_info``, ``request_param``, ``header`` and
2504   ``accept`` are now *route* predicates rather than *view* predicates.
2505   If one or more of these predicates is specified in the route
2506   configuration, all of the predicates must return true for the route
2507   to match a request.  If one or more of the route predicates
2508   associated with a route returns ``False`` when checked during a
2509   request, the route match fails, and the next match in the routelist
2510   is tried.  This differs from the previous behavior, where no route
2511   predicates existed and all predicates were considered view
2512   predicates, because in that scenario, the next route was not tried.
2513
2514 Documentation
2515 -------------
2516
2517 - Various changes were made to narrative and API documentation
2518   supporting the change from passing a request rather than an environ
2519   to root factories and traversers.
2520
2521 Internal
2522 --------
2523
2524 - The request implements dictionary-like methods that mutate and query
2525   the WSGI environ.  This is only for the purpose of backwards
2526   compatibility with root factories which expect an ``environ`` rather
2527   than a request.
2528
2529 - The ``repoze.bfg.request.create_route_request_factory`` function,
2530   which returned a request factory was removed in favor of a
2531   ``repoze.bfg.request.route_request_interface`` function, which
2532   returns an interface.
2533
2534 - The ``repoze.bfg.request.Request`` class, which is a subclass of
2535   ``webob.Request`` now defines its own ``__setattr__``,
2536   ``__getattr__`` and ``__delattr__`` methods, which override the
2537   default WebOb behavior.  The default WebOb behavior stores
2538   attributes of the request in ``self.environ['webob.adhoc_attrs']``,
2539   and retrieves them from that dictionary during a ``__getattr__``.
2540   This behavior was undesirable for speed and "expectation" reasons.
2541   Now attributes of the ``request`` are stored in ``request.__dict__``
2542   (as you otherwise might expect from an object that did not override
2543   these methods).
2544
2545 - The router no longer calls ``repoze.bfg.traversal._traverse`` and
2546   does its work "inline" (speed).
2547
2548 - Reverse the order in which the router calls the request factory and
2549   the root factory.  The request factory is now called first; the
2550   resulting request is passed to the root factory.
2551
2552 - The ``repoze.bfg.request.request_factory`` function has been
2553   removed.  Its functionality is no longer required.
2554
2555 - The "routes root factory" that wraps the default root factory when
2556   there are routes mentioned in the configuration now attaches an
2557   interface to the request via ``zope.interface.directlyProvides``.
2558   This replaces logic in the (now-gone)
2559   ``repoze.bfg.request.request_factory`` function.
2560
2561 - The ``route`` and ``view`` ZCML directives now register an interface
2562   as a named utility (retrieved from
2563   ``repoze.bfg.request.route_request_interface``) rather than a
2564   request factory (the previous return value of the now-missing 
2565   ``repoze.bfg.request.create_route_request_factory``.
2566
2567 - The ``repoze.bfg.functional`` module was renamed to
2568   ``repoze.bfg.compat``.
2569
2570 Backwards Incompatibilities
2571 ---------------------------
2572
2573 - Explicitly revert the feature introduced in 1.1a8: where the name
2574   ``root`` is available as an attribute of the request before a
2575   NewRequest event is emitted.  This makes some potential future
2576   features impossible, or at least awkward (such as grouping traversal
2577   and view lookup into a single adapter lookup).
2578
2579 - The ``containment``, ``attr`` and ``renderer`` attributes of the
2580   ``route`` ZCML directive were removed.
2581
2582 1.1a8 (2009-10-27)
2583 ==================
2584
2585 Features
2586 --------
2587
2588 - Add ``path_info`` view configuration predicate.
2589
2590 - ``paster bfgshell`` now supports IPython if it's available for
2591   import.  Thanks to Daniel Holth for the initial patch.
2592
2593 - Add ``repoze.bfg.testing.registerSettings`` API, which is documented
2594   in the "repoze.bfg.testing" API chapter.  This allows for
2595   registration of "settings" values obtained via
2596   ``repoze.bfg.settings.get_settings()`` for use in unit tests.
2597
2598 - The name ``root`` is available as an attribute of the request
2599   slightly earlier now (before a NewRequest event is emitted).
2600   ``root`` is the result of the application "root factory".
2601
2602 - Added ``max_age`` parameter to ``authtktauthenticationpolicy`` ZCML
2603   directive.  If this value is set, it must be an integer representing
2604   the number of seconds which the auth tkt cookie will survive.
2605   Mainly, its existence allows the auth_tkt cookie to survive across
2606   browser sessions.
2607
2608 Bug Fixes
2609 ---------
2610
2611 - Fix bug encountered during "scan" (when ``<scan ..>`` directive is
2612   used in ZCML) introduced in 1.1a7.  Symptom: ``AttributeError:
2613   object has no attribute __provides__`` raised at startup time.
2614
2615 - The ``reissue_time`` argument to the ``authtktauthenticationpolicy``
2616   ZCML directive now actually works.  When it is set to an integer
2617   value, an authticket set-cookie header is appended to the response
2618   whenever a request requires authentication and 'now' minus the
2619   authticket's timestamp is greater than ``reissue_time`` seconds.
2620
2621 Documentation
2622 -------------
2623
2624 - Add a chapter titled "Request and Response" to the narrative
2625   documentation, content cribbed from the WebOb documentation.
2626
2627 - Call out predicate attributes of ZCML directive within "Views"
2628   chapter.
2629
2630 - Fix route_url documentation (``_query`` argument documented as
2631   ``query`` and ``_anchor`` argument documented as ``anchor``).
2632
2633 Backwards Incompatibilities
2634 ---------------------------
2635
2636 - The ``authtkt`` authentication policy ``remember`` method now no
2637   longer honors ``token`` or ``userdata`` keyword arguments.
2638
2639 Internal
2640 --------
2641
2642 - Change how ``bfg_view`` decorator works when used as a class method
2643   decorator.  In 1.1a7, the``scan``directive actually tried to grope
2644   every class in scanned package at startup time, calling ``dir``
2645   against each found class, and subsequently invoking ``getattr``
2646   against each thing found by ``dir`` to see if it was a method.  This
2647   led to some strange symptoms (e.g. ``AttributeError: object has no
2648   attribute __provides__``), and was generally just a bad idea.  Now,
2649   instead of groping classes for methods at startup time, we just
2650   cause the ``bfg_view`` decorator itself to populate the method's
2651   class' ``__dict__`` when it is used as a method decorator.  This
2652   also requires a nasty _getframe thing but it's slightly less nasty
2653   than the startup time groping behavior.  This is essentially a
2654   reversion back to 1.1a6 "grokking" behavior plus some special magic
2655   for using the ``bfg_view`` decorator as method decorator inside the
2656   ``bfg_view`` class itself.
2657
2658 - The router now checks for a ``global_response_headers`` attribute of
2659   the request object before returning a response.  If this value
2660   exists, it is presumed to be a sequence of two-tuples, representing
2661   a set of headers to append to the 'normal' response headers.  This
2662   feature is internal, rather than exposed externally, because it's
2663   unclear whether it will stay around in the long term.  It was added
2664   to support the ``reissue_time`` feature of the authtkt
2665   authentication policy.
2666
2667 - The interface ITraverserFactory is now just an alias for ITraverser.
2668
2669 1.1a7 (2009-10-18)
2670 ==================
2671
2672 Features
2673 --------
2674
2675 - More than one ``@bfg_view`` decorator may now be stacked on top of
2676   any number of others.  Each invocation of the decorator registers a
2677   single view configuration.  For instance, the following combination
2678   of decorators and a function will register two view configurations
2679   for the same view callable::
2680
2681     from repoze.bfg.view import bfg_view
2682
2683     @bfg_view(name='edit')
2684     @bfg_view(name='change')
2685     def edit(context, request):
2686         pass
2687
2688   This makes it possible to associate more than one view configuration
2689   with a single callable without requiring any ZCML.
2690
2691 - The ``@bfg_view`` decorator can now be used against a class method::
2692
2693     from webob import Response
2694     from repoze.bfg.view import bfg_view
2695
2696     class MyView(object):
2697         def __init__(self, context, request):
2698             self.context = context
2699             self.request = request
2700
2701         @bfg_view(name='hello')
2702         def amethod(self):
2703             return Response('hello from %s!' % self.context)
2704
2705   When the bfg_view decorator is used against a class method, a view
2706   is registered for the *class* (it's a "class view" where the "attr"
2707   happens to be the name of the method it is attached to), so the
2708   class it's defined within must have a suitable constructor: one that
2709   accepts ``context, request`` or just ``request``.
2710
2711 Documentation
2712 -------------
2713
2714 - Added ``Changing the Traverser`` and ``Changing How
2715   :mod:`repoze.bfg.url.model_url` Generates a URL`` to the "Hooks"
2716   narrative chapter of the docs.
2717
2718 Internal
2719 --------
2720
2721 - Remove ``ez_setup.py`` and imports of it within ``setup.py``.  In
2722   the new world, and as per virtualenv setup instructions, people will
2723   already have either setuptools or distribute.
2724
2725 1.1a6 (2009-10-15)
2726 ==================
2727
2728 Features
2729 --------
2730
2731 - Add ``xhr``, ``accept``, and ``header`` view configuration
2732   predicates to ZCML view declaration, ZCML route declaration, and
2733   ``bfg_view`` decorator.  See the ``Views`` narrative documentation
2734   chapter for more information about these predicates.
2735
2736 - Add ``setUp`` and ``tearDown`` functions to the
2737   ``repoze.bfg.testing`` module.  Using ``setUp`` in a test setup and
2738   ``tearDown`` in a test teardown is now the recommended way to do
2739   component registry setup and teardown.  Previously, it was
2740   recommended that a single function named
2741   ``repoze.bfg.testing.cleanUp`` be called in both the test setup and
2742   tear down.  ``repoze.bfg.testing.cleanUp`` still exists (and will
2743   exist "forever" due to its widespread use); it is now just an alias
2744   for ``repoze.bfg.testing.setUp`` and is nominally deprecated.
2745
2746 - The BFG component registry is now available in view and event
2747   subscriber code as an attribute of the request
2748   ie. ``request.registry``.  This fact is currently undocumented
2749   except for this note, because BFG developers never need to interact
2750   with the registry directly anywhere else.
2751
2752 - The BFG component registry now inherits from ``dict``, meaning that
2753   it can optionally be used as a simple dictionary.  *Component*
2754   registrations performed against it via e.g. ``registerUtility``,
2755   ``registerAdapter``, and similar API methods are kept in a
2756   completely separate namespace than its dict members, so using the
2757   its component API methods won't effect the keys and values in the
2758   dictionary namespace.  Likewise, though the component registry
2759   "happens to be" a dictionary, use of mutating dictionary methods
2760   such as ``__setitem__`` will have no influence on any component
2761   registrations made against it.  In other words, the registry object
2762   you obtain via e.g. ``repoze.bfg.threadlocal.get_current_registry``
2763   or ``request.registry`` happens to be both a component registry and
2764   a dictionary, but using its component-registry API won't impact data
2765   added to it via its dictionary API and vice versa.  This is a
2766   forward compatibility move based on the goals of "marco".
2767
2768 - Expose and document ``repoze.bfg.testing.zcml_configure`` API.  This
2769   function populates a component registry from a ZCML file for testing
2770   purposes.  It is documented in the "Unit and Integration Testing"
2771   chapter.
2772
2773 Documentation
2774 -------------
2775
2776 - Virtual hosting narrative docs chapter updated with info about
2777   ``mod_wsgi``.
2778
2779 - Point all index URLs at the literal 1.1 index (this alpha cycle may
2780   go on a while).
2781
2782 - Various tutorial test modules updated to use
2783   ``repoze.bfg.testing.setUp`` and ``repoze.bfg.testing.tearDown``
2784   methods in order to encourage this as best practice going forward.
2785
2786 - Added "Creating Integration Tests" section to unit testing narrative
2787   documentation chapter.  As a result, the name of the unittesting
2788   chapter is now "Unit and Integration Testing".
2789
2790 Backwards Incompatibilities
2791 ---------------------------
2792
2793 - Importing ``getSiteManager`` and ``get_registry`` from
2794   ``repoze.bfg.registry`` is no longer supported.  These imports were
2795   deprecated in repoze.bfg 1.0.  Import of ``getSiteManager`` should
2796   be done as ``from zope.component import getSiteManager``.  Import of
2797   ``get_registry`` should be done as ``from repoze.bfg.threadlocal
2798   import get_current_registry``.  This was done to prevent a circular
2799   import dependency.
2800
2801 - Code bases which alternately invoke both
2802   ``zope.testing.cleanup.cleanUp`` and ``repoze.bfg.testing.cleanUp``
2803   (treating them equivalently, using them interchangeably) in the
2804   setUp/tearDown of unit tests will begin to experience test failures
2805   due to lack of test isolation.  The "right" mechanism is
2806   ``repoze.bfg.testing.cleanUp`` (or the combination of
2807   ``repoze.bfg.testing.setUp`` and
2808   ``repoze.bfg.testing.tearDown``). but a good number of legacy
2809   codebases will use ``zope.testing.cleanup.cleanUp`` instead.  We
2810   support ``zope.testing.cleanup.cleanUp`` but not in combination with
2811   ``repoze.bfg.testing.cleanUp`` in the same codebase.  You should use
2812   one or the other test cleanup function in a single codebase, but not
2813   both.
2814
2815 Internal
2816 --------
2817
2818 - Created new ``repoze.bfg.configuration`` module which assumes
2819   responsibilities previously held by the ``repoze.bfg.registry`` and
2820   ``repoze.bfg.router`` modules (avoid a circular import dependency).
2821
2822 - The result of the ``zope.component.getSiteManager`` function in unit
2823   tests set up with ``repoze.bfg.testing.cleanUp`` or
2824   ``repoze.bfg.testing.setUp`` will be an instance of
2825   ``repoze.bfg.registry.Registry`` instead of the global
2826   ``zope.component.globalregistry.base`` registry.  This also means
2827   that the threadlocal ZCA API functions such as ``getAdapter`` and
2828   ``getUtility`` as well as internal BFG machinery (such as
2829   ``model_url`` and ``route_url``) will consult this registry within
2830   unit tests. This is a forward compatibility move based on the goals
2831   of "marco".
2832
2833 - Removed ``repoze.bfg.testing.addCleanUp`` function and associated
2834   module-scope globals.  This was never an API.
2835
2836 1.1a5 (2009-10-10)
2837 ==================
2838
2839 Documentation
2840 -------------
2841
2842 - Change "Traversal + ZODB" and "URL Dispatch + SQLAlchemy" Wiki
2843   tutorials to make use of the new-to-1.1 "renderer" feature (return
2844   dictionaries from all views).
2845
2846 - Add tests to the "URL Dispatch + SQLAlchemy" tutorial after the
2847   "view" step.
2848
2849 - Added a diagram of model graph traversal to the "Traversal"
2850   narrative chapter of the documentation.
2851
2852 - An ``exceptions`` API chapter was added, documenting the new
2853   ``repoze.bfg.exceptions`` module.
2854
2855 - Describe "request-only" view calling conventions inside the
2856   urldispatch narrative chapter, where it's most helpful.
2857
2858 - Add a diagram which explains the operation of the BFG router to the
2859   "Router" narrative chapter.
2860
2861 Features
2862 --------
2863
2864 - Add a new ``repoze.bfg.testing`` API: ``registerRoute``, for
2865   registering routes to satisfy calls to
2866   e.g. ``repoze.bfg.url.route_url`` in unit tests.
2867
2868 - The ``notfound`` and ``forbidden`` ZCML directives now accept the
2869   following addtional attributes: ``attr``, ``renderer``, and
2870   ``wrapper``.  These have the same meaning as they do in the context
2871   of a ZCML ``view`` directive.
2872
2873 - For behavior like Django's ``APPEND_SLASH=True``, use the
2874   ``repoze.bfg.view.append_slash_notfound_view`` view as the Not Found
2875   view in your application.  When this view is the Not Found view
2876   (indicating that no view was found), and any routes have been
2877   defined in the configuration of your application, if the value of
2878   ``PATH_INFO`` does not already end in a slash, and if the value of
2879   ``PATH_INFO`` *plus* a slash matches any route's path, do an HTTP
2880   redirect to the slash-appended PATH_INFO.  Note that this will
2881   *lose* ``POST`` data information (turning it into a GET), so you
2882   shouldn't rely on this to redirect POST requests.
2883
2884 - Speed up ``repoze.bfg.location.lineage`` slightly.
2885
2886 - Speed up ``repoze.bfg.encode.urlencode`` (nee'
2887   ``repoze.bfg.url.urlencode``) slightly.
2888
2889 - Speed up ``repoze.bfg.traversal.model_path``.
2890
2891 - Speed up ``repoze.bfg.traversal.model_path_tuple`` slightly.
2892
2893 - Speed up ``repoze.bfg.traversal.traverse`` slightly.
2894
2895 - Speed up ``repoze.bfg.url.model_url`` slightly.
2896
2897 - Speed up ``repoze.bfg.url.route_url`` slightly.
2898
2899 - Sped up ``repoze.bfg.traversal.ModelGraphTraverser:__call__``
2900   slightly.
2901
2902 - Minor speedup of ``repoze.bfg.router.Router.__call__``.
2903
2904 - New ``repoze.bfg.exceptions`` module was created to house exceptions
2905   that were previously sprinkled through various modules.
2906
2907 Internal
2908 --------
2909
2910 - Move ``repoze.bfg.traversal._url_quote`` into ``repoze.bfg.encode``
2911   as ``url_quote``.
2912
2913 Deprecations
2914 ------------
2915
2916 - The import of ``repoze.bfg.view.NotFound`` is deprecated in favor of
2917   ``repoze.bfg.exceptions.NotFound``.  The old location still
2918   functions, but emits a deprecation warning.
2919
2920 - The import of ``repoze.bfg.security.Unauthorized`` is deprecated in
2921   favor of ``repoze.bfg.exceptions.Forbidden``.  The old location
2922   still functions but emits a deprecation warning.  The rename from
08c221 2923   ``Unauthorized`` to ``Forbidden`` brings parity to the name of
b7c935 2924   the exception and the system view it invokes when raised.
CM 2925
2926 Backwards Incompatibilities
2927 ---------------------------
2928
2929 - We previously had a Unicode-aware wrapper for the
2930   ``urllib.urlencode`` function named ``repoze.bfg.url.urlencode``
2931   which delegated to the stdlib function, but which marshalled all
2932   unicode values to utf-8 strings before calling the stdlib version.
2933   A newer replacement now lives in ``repoze.bfg.encode`` The
2934   replacement does not delegate to the stdlib.
2935
2936   The replacement diverges from the stdlib implementation and the
2937   previous ``repoze.bfg.url`` url implementation inasmuch as its
2938   ``doseq`` argument is now a decoy: it always behaves in the
2939   ``doseq=True`` way (which is the only sane behavior) for speed
2940   purposes.
2941
2942   The old import location (``repoze.bfg.url.urlencode``) still
2943   functions and has not been deprecated.
2944
2945 - In 0.8a7, the return value expected from an object implementing
2946   ``ITraverserFactory`` was changed from a sequence of values to a
2947   dictionary containing the keys ``context``, ``view_name``,
2948   ``subpath``, ``traversed``, ``virtual_root``, ``virtual_root_path``,
2949   and ``root``.  Until now, old-style traversers which returned a
2950   sequence have continued to work but have generated a deprecation
2951   warning.  In this release, traversers which return a sequence
2952   instead of a dictionary will no longer work.
2953
2954 1.1a4 (2009-09-23)
2955 ==================
2956
2957 Bug Fixes
2958 ---------
2959
2960 - On 64-bit Linux systems, views that were members of a multiview
2961   (orderings of views with predicates) were not evaluated in the
2962   proper order.  Symptom: in a configuration that had two views with
2963   the same name but one with a ``request_method=POST`` predicate and
2964   one without, the one without the predicate would be called
2965   unconditionally (even if the request was a POST request).  Thanks
2966   much to Sebastien Douche for providing the buildbots that pointed
2967   this out.
2968
2969 Documentation
2970 -------------
2971
2972 - Added a tutorial which explains how to use ``repoze.session``
2973   (ZODB-based sessions) in a ZODB-based repoze.bfg app.
2974
2975 - Added a tutorial which explains how to add ZEO to a ZODB-based
2976   ``repoze.bfg`` application.
2977
2978 - Added a tutorial which explains how to run a ``repoze.bfg``
2979   application under `mod_wsgi <http://code.google.com/p/modwsgi/>`_.
2980   See "Running a repoze.bfg Application under mod_wsgi" in the
2981   tutorials section of the documentation.
2982
2983 Features
2984 --------
2985
2986 - Add a ``repoze.bfg.url.static_url`` API which is capable of
2987   generating URLs to static resources defined by the ``<static>`` ZCML
2988   directive.  See the "Views" narrative chapter's section titled
2989   "Generating Static Resource URLs" for more information.
2990
2991 - Add a ``string`` renderer.  This renderer converts a non-Response
2992   return value of any view callble into a string.  It is documented in
2993   the "Views" narrative chapter.
2994
2995 - Give the ``route`` ZCML directive the ``view_attr`` and
2996   ``view_renderer`` parameters (bring up to speed with 1.1a3
2997   features).  These can also be spelled as ``attr`` and ``renderer``.
2998
2999 Backwards Incompatibilities
3000 ---------------------------
3001
3002 - An object implementing the ``IRenderer`` interface (and
3003   ``ITemplateRenderer`, which is a subclass of ``IRenderer``) must now
3004   accept an extra ``system`` argument in its ``__call__`` method
3005   implementation.  Values computed by the system (as opposed to by the
3006   view) are passed by the system in the ``system`` parameter, which
3007   will always be a dictionary.  Keys in the dictionary include:
3008   ``view`` (the view object that returned the value),
3009   ``renderer_name`` (the template name or simple name of the
3010   renderer), ``context`` (the context object passed to the view), and
3011   ``request`` (the request object passed to the view).  Previously
3012   only ITemplateRenderers received system arguments as elements inside
3013   the main ``value`` dictionary.
3014
3015 Internal
3016 --------
3017
3018 - The way ``bfg_view`` declarations are scanned for has been modified.
3019   This should have no external effects.
3020
3021 - Speed: do not register an ITraverserFactory in configure.zcml;
3022   instead rely on queryAdapter and a manual default to
3023   ModelGraphTraverser.
3024
3025 - Speed: do not register an IContextURL in configure.zcml; instead
3026   rely on queryAdapter and a manual default to TraversalContextURL.
3027
3028 - General speed microimprovements for helloworld benchmark: replace
3029   try/excepts with statements which use 'in' keyword.
3030
3031 1.1a3 (2009-09-16)
3032 ==================
3033
3034 Documentation
3035 -------------
3036
3037 - The "Views" narrative chapter in the documentation has been updated
3038   extensively to discuss "renderers".
3039
3040 Features
3041 --------
3042
3043 - A ``renderer`` attribute has been added to view configurations,
3044   replacing the previous (1.1a2) version's ``template`` attribute.  A
3045   "renderer" is an object which accepts the return value of a view and
3046   converts it to a string.  This includes, but is not limited to,
3047   templating systems.
3048
3049 - A new interface named ``IRenderer`` was added.  The existing
3050   interface, ``ITemplateRenderer`` now derives from this new
3051   interface.  This interface is internal.
3052
3053 - A new interface named ``IRendererFactory`` was added.  An existing
3054   interface named ``ITemplateRendererFactory`` now derives from this
3055   interface.  This interface is internal.
3056
3057 - The ``view`` attribute of the ``view`` ZCML directive is no longer
3058   required if the ZCML directive also has a ``renderer`` attribute.
3059   This is useful when the renderer is a template renderer and no names
3060   need be passed to the template at render time.
3061
3062 - A new zcml directive ``renderer`` has been added.  It is documented
3063   in the "Views" narrative chapter of the documentation.
3064
3065 - A ZCML ``view`` directive (and the associated ``bfg_view``
3066   decorator) can now accept a "wrapper" value.  If a "wrapper" value
3067   is supplied, it is the value of a separate view's *name* attribute.
3068   When a view with a ``wrapper`` attribute is rendered, the "inner"
3069   view is first rendered normally.  Its body is then attached to the
3070   request as "wrapped_body", and then a wrapper view name is looked up
3071   and rendered (using ``repoze.bfg.render_view_to_response``), passed
3072   the request and the context.  The wrapper view is assumed to do
3073   something sensible with ``request.wrapped_body``, usually inserting
3074   its structure into some other rendered template.  This feature makes
3075   it possible to specify (potentially nested) "owrap" relationships
3076   between views using only ZCML or decorators (as opposed always using
3077   ZPT METAL and analogues to wrap view renderings in outer wrappers).
3078
3079 Dependencies
3080 ------------
3081
3082 - When used under Python < 2.6, BFG now has an installation time
3083   dependency on the ``simplejson`` package.
3084
3085 Deprecations
3086 ------------
3087
3088 - The ``repoze.bfg.testing.registerDummyRenderer`` API has been
3089   deprecated in favor of
3090   ``repoze.bfg.testing.registerTemplateRenderer``.  A deprecation
3091   warning is *not* issued at import time for the former name; it will
3092   exist "forever"; its existence has been removed from the
3093   documentation, however.
3094
3095 - The ``repoze.bfg.templating.renderer_from_cache`` function has been
3096   moved to ``repoze.bfg.renderer.template_renderer_factory``.  This
3097   was never an API, but code in the wild was spotted that used it.  A
3098   deprecation warning is issued at import time for the former.
3099
3100 Backwards Incompatibilities
3101 ---------------------------
3102
3103 - The ``ITemplateRenderer`` interface has been changed.  Previously
3104   its ``__call__`` method accepted ``**kw``.  It now accepts a single
3105   positional parameter named ``kw`` (REVISED: it accepts two
3106   positional parameters as of 1.1a4: ``value`` and ``system``).  This
3107   is mostly an internal change, but it was exposed in APIs in one
3108   place: if you've used the
3109   ``repoze.bfg.testing.registerDummyRenderer`` API in your tests with
3110   a custom "renderer" argument with your own renderer implementation,
3111   you will need to change that renderer implementation to accept
3112   ``kw`` instead of ``**kw`` in its ``__call__`` method (REVISED: make
3113   it accept ``value`` and ``system`` positional arguments as of 1.1a4).
3114
3115 - The ``ITemplateRendererFactory`` interface has been changed.
3116   Previously its ``__call__`` method accepted an ``auto_reload``
3117   keyword parameter.  Now its ``__call__`` method accepts no keyword
3118   parameters.  Renderers are now themselves responsible for
3119   determining details of auto-reload.  This is purely an internal
3120   change.  This interface was never external.
3121
3122 - The ``template_renderer`` ZCML directive introduced in 1.1a2 has
3123   been removed.  It has been replaced by the ``renderer`` directive.
3124
3125 - The previous release (1.1a2) added a view configuration attribute
3126   named ``template``.  In this release, the attribute has been renamed
3127   to ``renderer``.  This signifies that the attribute is more generic:
3128   it can now be not just a template name but any renderer name (ala
3129   ``json``).  
3130
3131 - In the previous release (1.1a2), the Chameleon text template
3132   renderer was used if the system didn't associate the ``template``
3133   view configuration value with a filename with a "known" extension.
3134   In this release, you must use a ``renderer`` attribute which is a
3135   path that ends with a ``.txt`` extension
3136   (e.g. ``templates/foo.txt``) to use the Chameleon text renderer.
3137
3138 1.1a2 (2009-09-14)
3139 ==================
3140
3141 Features
3142 --------
3143
3144 - A ZCML ``view`` directive (and the associated ``bfg_view``
3145   decorator) can now accept an "attr" value.  If an "attr" value is
3146   supplied, it is considered a method named of the view object to be
3147   called when the response is required.  This is typically only good
3148   for views that are classes or instances (not so useful for
3149   functions, as functions typically have no methods other than
3150   ``__call__``).
3151
3152 - A ZCML ``view`` directive (and the associated ``bfg_view``
3153   decorator) can now accept a "template" value.  If a "template" value
3154   is supplied, and the view callable returns a dictionary, the
3155   associated template is rendered with the dictionary as keyword
3156   arguments.  See the section named "Views That Have a ``template``"
3157   in the "Views" narrative documentation chapter for more information.
3158
3159 1.1a1 (2009-09-06)
3160 ==================
3161
3162 Bug Fixes
3163 ---------
3164
3165 - "tests" module removed from the bfg_alchemy paster template; these
3166   tests didn't work.
3167
3168 - Bugfix: the ``discriminator`` for the ZCML "route" directive was
3169   incorrect.  It was possible to register two routes that collided
3170   without the system spitting out a ConfigurationConflictError at
3171   startup time.
3172
3173 Features
3174 --------
3175
3176 - Feature addition: view predicates.  These are exposed as the
3177   ``request_method``, ``request_param``, and ``containment``
3178   attributes of a ZCML ``view`` declaration, or the respective
3179   arguments to a ``@bfg_view`` decorator.  View predicates can be used
3180   to register a view for a more precise set of environment parameters
3181   than was previously possible.  For example, you can register two
3182   views with the same ``name`` with different ``request_param``
3183   attributes.  If the ``request.params`` dict contains 'foo'
3184   (request_param="foo"), one view might be called; if it contains
3185   'bar' (request_param="bar"), another view might be called.
3186   ``request_param`` can also name a key/value pair ala ``foo=123``.
3187   This will match only when the ``foo`` key is in the request.params
3188   dict and it has the value '123'.  This particular example makes it
3189   possible to write separate view functions for different form
3190   submissions.  The other predicates, ``containment`` and
3191   ``request_method`` work similarly.  ``containment`` is a view
3192   predicate that will match only when the context's graph lineage has
3193   an object possessing a particular class or interface, for example.
3194   ``request_method`` is a view predicate that will match when the HTTP
3195   ``REQUEST_METHOD`` equals some string (eg. 'POST').
3196
3197 - The ``@bfg_view`` decorator now accepts three additional arguments:
3198   ``request_method``, ``request_param``, and ``containment``.
3199   ``request_method`` is used when you'd like the view to match only a
3200   request with a particular HTTP ``REQUEST_METHOD``; a string naming
3201   the ``REQUEST_METHOD`` can also be supplied as ``request_type`` for
3202   backwards compatibility.  ``request_param`` is used when you'd like
3203   a view to match only a request that contains a particular
3204   ``request.params`` key (with or without a value).  ``containment``
3205   is used when you'd like to match a request that has a context that
3206   has some class or interface in its graph lineage.  These are
3207   collectively known as "view predicates".
3208
3209 - The ``route`` ZCML directive now honors ``view_request_method``,
3210   ``view_request_param`` and ``view_containment`` attributes, which
3211   pass along these values to the associated view if any is provided.
3212   Additionally, the ``request_type`` attribute can now be spelled as
3213   ``view_request_type``, and ``permission`` can be spelled as
3214   ``view_permission``.  Any attribute which starts with ``view_`` can
3215   now be spelled without the ``view_`` prefix, so ``view_for`` can be
3216   spelled as ``for`` now, etc.  Both forms are documented in the
3217   urldispatch narraitve documentation chapter.
3218
3219 - The ``request_param`` ZCML view directive attribute (and its
3220   ``bfg_view`` decorator cousin) can now specify both a key and a
3221   value.  For example, ``request_param="foo=123"`` means that the foo
3222   key must have a value of ``123`` for the view to "match".
3223
3224 - Allow ``repoze.bfg.traversal.find_interface`` API to use a class
3225   object as the argument to compare against the ``model`` passed in.
3226   This means you can now do ``find_interface(model, SomeClass)`` and
3227   the first object which is found in the lineage which has
3228   ``SomeClass`` as its class (or the first object found which has
3229   ``SomeClass`` as any of its superclasses) will be returned.
3230
3231 - Added ``static`` ZCML directive which registers a route for a view
3232   that serves up files in a directory.  See the "Views" narrative
3233   documentation chapter's "Serving Static Resources Using a ZCML
3234   Directive" section for more information.
3235
3236 - The ``repoze.bfg.view.static`` class now accepts a string as its
3237   first argument ("root_dir") that represents a package-relative name
3238   e.g. ``somepackage:foo/bar/static``.  This is now the preferred
3239   mechanism for spelling package-relative static paths using this
3240   class.  A ``package_name`` keyword argument has been left around for
3241   backwards compatibility.  If it is supplied, it will be honored.
3242
3243 - The API ``repoze.bfg.testing.registerView`` now takes a
3244   ``permission`` argument.  Use this instead of using
3245   ``repoze.bfg.testing.registerViewPermission``.
3246
3247 - The ordering of route declarations vs. the ordering of view
3248   declarations that use a "route_name" in ZCML no longer matters.
3249   Previously it had been impossible to use a route_name from a route
3250   that had not yet been defined in ZCML (order-wise) within a "view"
3251   declaration.
3252
3253 - The repoze.bfg router now catches both
3254   ``repoze.bfg.security.Unauthorized`` and
3255   ``repoze.bfg.view.NotFound`` exceptions while rendering a view.
3256   When the router catches an ``Unauthorized``, it returns the
3257   registered forbidden view.  When the router catches a ``NotFound``,
3258   it returns the registered notfound view.
3259
3260 Internal
3261 --------
3262
3263 - Change urldispatch internals: Route object is now constructed using
3264   a path, a name, and a factory instead of a name, a matcher, a
3265   generator, and a factory.
3266
3267 - Move (non-API) default_view, default_forbidden_view, and
3268   default_notfound_view functions into the ``repoze.bfg.view`` module
3269   (moved from ``repoze.bfg.router``).
3270
3271 - Removed ViewPermissionFactory from ``repoze.bfg.security``.  View
3272   permission checking is now done by registering and looking up an
3273   ISecuredView.
3274
3275 - The ``static`` ZCML directive now uses a custom root factory when
3276   constructing a route.
3277
3278 - The interface ``IRequestFactories`` was removed from the
3279   repoze.bfg.interfaces module.  This interface was never an API.
3280
3281 - The function named ``named_request_factories`` and the data
3282   structure named ``DEFAULT_REQUEST_FACTORIES`` have been removed from
3283   the ``repoze.bfg.request`` module.  These were never APIs.
3284
3285 - The ``IViewPermissionFactory`` interface has been removed.  This was
3286   never an API.
3287
3288 Documentation
3289 -------------
3290
3291 - Request-only-convention examples in the "Views" narrative
3292   documentation were broken.
3293
3294 - Fixed documentation bugs related to forget and remember in security API
3295   docs.
3296
3297 - Fixed documentation for ``repoze.bfg.view.static`` (in narrative
3298   ``Views`` chapter).
3299
3300 Deprecations
3301 ------------
3302
3303 - The API ``repoze.bfg.testing.registerViewPermission`` has been
3304   deprecated.
3305
3306 Backwards Incompatibilities
3307 ---------------------------
3308
3309 - The interfaces ``IPOSTRequest``, ``IGETRequest``, ``IPUTRequest``,
3310   ``IDELETERequest``, and ``IHEADRequest`` have been removed from the
3311   ``repoze.bfg.interfaces`` module.  These were not documented as APIs
3312   post-1.0.  Instead of using one of these, use a ``request_method``
3313   ZCML attribute or ``request_method`` bfg_view decorator parameter
3314   containing an HTTP method name (one of ``GET``, ``POST``, ``HEAD``,
3315   ``PUT``, ``DELETE``) instead of one of these interfaces if you were
3316   using one explicitly.  Passing a string in the set (``GET``,
3317   ``HEAD``, ``PUT``, ``POST``, ``DELETE``) as a ``request_type``
3318   argument will work too.  Rationale: instead of relying on interfaces
3319   attached to the request object, BFG now uses a "view predicate" to
3320   determine the request type.
3321
3322 - Views registered without the help of the ZCML ``view`` directive are
3323   now responsible for performing their own authorization checking.
3324
3325 - The ``registry_manager`` backwards compatibility alias importable
3326   from "repoze.bfg.registry", deprecated since repoze.bfg 0.9 has been
3327   removed.  If you are tring to use the registry manager within a
3328   debug script of your own, use a combination of the
3329   "repoze.bfg.paster.get_app" and "repoze.bfg.scripting.get_root" APIs
3330   instead.
3331
3332 - The ``INotFoundAppFactory`` interface has been removed; it has
3333   been deprecated since repoze.bfg 0.9.  If you have something like
3334   the following in your ``configure.zcml``::
3335
3336    <utility provides="repoze.bfg.interfaces.INotFoundAppFactory"
3337             component="helloworld.factories.notfound_app_factory"/>
3338
3339   Replace it with something like::
3340
3341    <notfound 
3342        view="helloworld.views.notfound_view"/>
3343
3344   See "Changing the Not Found View" in the "Hooks" chapter of the
3345   documentation for more information.
3346
3347 - The ``IUnauthorizedAppFactory`` interface has been removed; it has
3348   been deprecated since repoze.bfg 0.9.  If you have something like
3349   the following in your ``configure.zcml``::
3350
3351    <utility provides="repoze.bfg.interfaces.IUnauthorizedAppFactory"
3352             component="helloworld.factories.unauthorized_app_factory"/>
3353
3354   Replace it with something like::
3355
3356    <forbidden
3357        view="helloworld.views.forbidden_view"/>
3358
3359   See "Changing the Forbidden View" in the "Hooks" chapter of the
3360   documentation for more information.
3361
3362 - ``ISecurityPolicy``-based security policies, deprecated since
3363   repoze.bfg 0.9, have been removed.  If you have something like this
3364   in your ``configure.zcml``, it will no longer work::
3365
3366      <utility
3367        provides="repoze.bfg.interfaces.ISecurityPolicy"
3368        factory="repoze.bfg.security.RemoteUserInheritingACLSecurityPolicy"
3369       />
3370
3371   If ZCML like the above exists in your application, you will receive
3372   an error at startup time.  Instead of the above, you'll need
3373   something like::
3374
3375      <remoteuserauthenticationpolicy/>
3376      <aclauthorizationpolicy/>
3377
3378   This is just an example.  See the "Security" chapter of the
3379   repoze.bfg documentation for more information about configuring
3380   security policies.
3381
3382 - Custom ZCML directives which register an authentication or
3383   authorization policy (ala "authtktauthenticationpolicy" or
3384   "aclauthorizationpolicy") should register the policy "eagerly" in
3385   the ZCML directive instead of from within a ZCML action.  If an
3386   authentication or authorization policy is not found in the component
3387   registry by the view machinery during deferred ZCML processing, view
3388   security will not work as expected.
3389
3390 1.0.1 (2009-07-22)
3391 ==================
3392
3393 - Added support for ``has_resource``, ``resource_isdir``, and
3394   ``resource_listdir`` to the resource "OverrideProvider"; this fixes
3395   a bug with a symptom that a file could not be overridden in a
3396   resource directory unless a file with the same name existed in the
3397   original directory being overridden.
3398
3399 - Fixed documentation bug showing invalid test for values from the
3400   ``matchdict``:  they are stored as attributes of the ``Article``, rather
3401   than subitems.
3402
3403 - Fixed documentation bug showing wrong environment key for the ``matchdict``
3404   produced by the matching route.
3405
3406 - Added a workaround for a bug in Python 2.6, 2.6.1, and 2.6.2 having
3407   to do with a recursion error in the mimetypes module when trying to
3408   serve static files from Paste's FileApp:
3409   http://bugs.python.org/issue5853.  Symptom: File
3410   "/usr/lib/python2.6/mimetypes.py", line 244, in guess_type return
3411   guess_type(url, strict) RuntimeError: maximum recursion depth
3412   exceeded.  Thanks to Armin Ronacher for identifying the symptom and
3413   pointing out a fix.
3414
3415 - Minor edits to tutorials for accuracy based on feedback.
3416
3417 - Declared Paste and PasteDeploy dependencies.
3418
3419 1.0 (2009-07-05)
3420 ================
3421
3422 - Retested and added some content to GAE tutorial.
3423
3424 - Edited "Extending" narrative docs chapter.
3425
3426 - Added "Deleting the Database" section to the "Defining Models"
3427   chapter of the traversal wiki tutorial.
3428
3429 - Spell checking of narratives and tutorials.
3430
3431 1.0b2 (2009-07-03)
3432 ==================
3433
3434 - ``remoteuserauthenticationpolicy`` ZCML directive didn't work
3435   without an ``environ_key`` directive (didn't match docs).
3436
3437 - Fix ``configure_zcml`` filespec check on Windows.  Previously if an
3438   absolute filesystem path including a drive letter was passed as
3439   ``filename`` (or as ``configure_zcml`` in the options dict) to
3440   ``repoze.bfg.router.make_app``, it would be treated as a
3441   package:resource_name specification.
3442
3443 - Fix inaccuracies and import errors in bfgwiki (traversal+ZODB) and
3444   bfgwiki2 (urldispatch+SA) tutorials.
3445
3446 - Use bfgsite index for all tutorial setup.cfg files.
3447
3448 - Full documentation grammar/style/spelling audit.
3449
3450 1.0b1 (2009-07-02)
3451 ==================
3452
3453 Features
3454 --------
3455
3456 - Allow a Paste config file (``configure_zcml``) value or an
3457   environment variable (``BFG_CONFIGURE_ZCML``) to name a ZCML file
3458   (optionally package-relative) that will be used to bootstrap the
3459   application.  Previously, the integrator could not influence which
3460   ZCML file was used to do the boostrapping (only the original
3461   application developer could do so).
3462
3463 Documentation
3464 -------------
3465
3466 - Added a "Resources" chapter to the narrative documentation which
3467   explains how to override resources within one package from another
3468   package.
3469
3470 - Added an "Extending" chapter to the narrative documentation which
3471   explains how to extend or modify an existing BFG application using
3472   another Python package and ZCML.
3473
3474 1.0a9 (2009-07-01)
3475 ==================
3476
3477 Features
3478 --------
3479
3480 - Make it possible to pass strings in the form
3481   "package_name:relative/path" to APIs like ``render_template``,
3482   ``render_template_to_response``, and ``get_template``.  Sometimes
3483   the package in which a caller lives is a direct namespace package,
3484   so the module which is returned is semi-useless for navigating from.
3485   In this way, the caller can control the horizontal and vertical of
3486   where things get looked up from.
3487
3488 1.0a8 (2009-07-01)
3489 ==================
3490
3491 Deprecations
3492 ------------
3493
3494 - Deprecate the ``authentication_policy`` and ``authorization_policy``
3495   arguments to ``repoze.bfg.router.make_app``.  Instead, developers
3496   should use the various authentication policy ZCML directives
3497   (``repozewho1authenticationpolicy``,
3498   ``remoteuserauthenticationpolicy`` and
3499   ``authtktauthenticationpolicy``) and the `aclauthorizationpolicy``
3500   authorization policy directive as described in the changes to the
3501   "Security" narrative documenation chapter and the wiki tutorials.
3502
3503 Features
3504 --------
3505
3506 - Add three new ZCML directives which configure authentication
3507   policies:
3508
3509   - ``repozewho1authenticationpolicy``
3510
3511   - ``remoteuserauthenticationpolicy``
3512
3513   - ``authtktauthenticationpolicy``
3514
3515 - Add a new ZCML directive which configures an ACL authorization
3516   policy named ``aclauthorizationpolicy``.
3517
3518 Bug Fixes
3519 ---------
3520
3521 - Bug fix: when a ``repoze.bfg.resource.PackageOverrides`` class was
3522   instantiated, and the package it was overriding already had a
3523   ``__loader__`` attribute, it would fail at startup time, even if the
3524   ``__loader__`` attribute was another PackageOverrides instance.  We
3525   now replace any ``__loader__`` that is also a PackageOverrides
3526   instance.  Symptom: ``ConfigurationExecutionError: <type
3527   'exceptions.TypeError'>: Package <module 'karl.views' from
3528   '/Users/chrism/projects/osi/bfgenv/src/karl/karl/views/__init__.pyc'>
3529   already has a __loader__ (probably a module in a zipped egg)``.
3530
3531 1.0a7 (2009-06-30)
3532 ==================
3533
3534 Features
3535 --------
3536
3537 - Add a ``reload_resources`` configuration file setting (aka the
3538   ``BFG_RELOAD_RESOURCES`` environment variable).  When this is set to
3539   true, the server never needs to be restarted when moving files
3540   between directory resource overrides (esp. for templates currently).
3541
3542 - Add a ``reload_all`` configuration file setting (aka the
3543   ``BFG_RELOAD_ALL`` environment variable) that implies both
3544   ``reload_resources`` and ``reload_templates``.
3545
3546 - The ``static`` helper view class now uses a ``PackageURLParser`` in
3547   order to allow for the overriding of static resources (CSS / logo
3548   files, etc) using the ``resource`` ZCML directive.  The
3549   ``PackageURLParser`` class was added to a (new) ``static`` module in
3550   BFG; it is a subclass of the ``StaticURLParser`` class in
3551   ``paste.urlparser``.
3552
3553 - The ``repoze.bfg.templating.renderer_from_cache`` function now
3554   checks for the ``reload_resources`` setting; if it's true, it does
3555   not register a template renderer (it won't use the registry as a
3556   template renderer cache).
3557
3558 Documentation
3559 -------------
3560
3561 - Add ``pkg_resources`` to the glossary.
3562
3563 - Update the "Environment" docs to note the existence of
3564   ``reload_resources`` and ``reload_all``.
3565
3566 - Updated the ``bfg_alchemy`` paster template to include two views:
3567   the view on the root shows a list of links to records;  the view on
3568   a record shows the details for that object.
3569
3570 Internal
3571 --------
3572
3573 - Use a colon instead of a tab as the separator between package name
3574   and relpath to form the "spec" when register a ITemplateRenderer.
3575
3576 - Register a ``repoze.bfg.resource.OverrideProvider`` as a
3577   pkg_resources provider only for modules which are known to have
3578   overrides, instead of globally, when a <resource> directive is used
3579   (performance).
3580
3581 1.0a6 (2009-06-29)
3582 ==================
3583
3584 Bug Fixes
3585 ---------
3586
3587 - Use ``caller_package`` function instead of ``caller_module``
3588   function within ``templating`` to avoid needing to name the caller
3589   module in resource overrides (actually match docs).
3590
3591 - Make it possible to override templates stored directly in a module
3592   with templates in a subdirectory of the same module, stored directly
3593   within another module, or stored in a subdirectory of another module
3594   (actually match docs).
3595
3596 1.0a5 (2009-06-28)
3597 ==================
3598
3599 Features
3600 --------
3601
3602 - A new ZCML directive exists named "resource".  This ZCML directive
3603   allows you to override Chameleon templates within a package (both
3604   directories full of templates and individual template files) with
3605   other templates in the same package or within another package.  This
3606   allows you to "fake out" a view's use of a template, causing it to
3607   retrieve a different template than the one actually named by a
3608   relative path to a call like
3609   ``render_template_to_response('templates/mytemplate.pt')``.  For
3610   example, you can override a template file by doing::
3611
3612     <resource
3613       to_override="some.package:templates/mytemplate.pt"
3614       override_with="another.package:othertemplates/anothertemplate.pt"
3615      />
3616
3617   The string passed to "to_override" and "override_with" is named a
3618   "specification".  The colon separator in a specification separates
3619   the package name from a package-relative directory name.  The colon
3620   and the following relative path are optional.  If they are not
3621   specified, the override attempts to resolve every lookup into a
3622   package from the directory of another package.  For example::
3623
3624     <resource
3625       to_override="some.package"
3626       override_with="another.package"
3627      />
3628
3629
3630   Individual subdirectories within a package can also be overridden::
3631
3632     <resource
3633       to_override="some.package:templates/"
3634       override_with="another.package:othertemplates/"
3635      />
3636
3637   If you wish to override a directory with another directory, you must
3638   make sure to attach the slash to the end of both the ``to_override``
3639   specification and the ``override_with`` specification.  If you fail
3640   to attach a slash to the end of a specification that points a
3641   directory, you will get unexpected results.  You cannot override a
3642   directory specification with a file specification, and vice versa (a
3643   startup error will occur if you try).
3644
3645   You cannot override a resource with itself (a startup error will
3646   occur if you try).
3647
3648   Only individual *package* resources may be overridden.  Overrides
3649   will not traverse through subpackages within an overridden package.
3650   This means that if you want to override resources for both
3651   ``some.package:templates``, and ``some.package.views:templates``,
3652   you will need to register two overrides.
3653
3654   The package name in a specification may start with a dot, meaning
3655   that the package is relative to the package in which the ZCML file
3656   resides.  For example::
3657
3658     <resource
3659       to_override=".subpackage:templates/"
3660       override_with="another.package:templates/"
3661      />
3662
3663   Overrides for the same ``to_overrides`` specification can be named
3664   multiple times within ZCML.  Each ``override_with`` path will be
3665   consulted in the order defined within ZCML, forming an override
3666   search path.
3667
3668   Resource overrides can actually override resources other than
3669   templates.  Any software which uses the ``pkg_resources``
3670   ``get_resource_filename``, ``get_resource_stream`` or
3671   ``get_resource_string`` APIs will obtain an overridden file when an
3672   override is used.  However, the only built-in facility which uses
3673   the ``pkg_resources`` API within BFG is the templating stuff, so we
3674   only call out template overrides here.
3675
3676 - Use the ``pkg_resources`` API to locate template filenames instead
3677   of dead-reckoning using the ``os.path`` module.
3678
3679 - The ``repoze.bfg.templating`` module now uses ``pkg_resources`` to
3680   locate and register template files instead of using an absolute
3681   path name.
3682
3683 1.0a4 (2009-06-25)
3684 ==================
3685
3686 Features
3687 --------
3688
3689 - Cause ``:segment`` matches in route paths to put a Unicode-decoded
3690   and URL-dequoted value in the matchdict for the value matched.
3691   Previously a non-decoded non-URL-dequoted string was placed in the
3692   matchdict as the value.
3693
3694 - Cause ``*remainder`` matches in route paths to put a *tuple* in the
3695   matchdict dictionary in order to be able to present Unicode-decoded
3696   and URL-dequoted values for the traversal path.  Previously a
3697   non-decoded non-URL-dequoted string was placed in the matchdict as
3698   the value.
3699
3700 - Add optional ``max_age`` keyword value to the ``remember`` method of
3701   ``repoze.bfg.authentication.AuthTktAuthenticationPolicy``; if this
3702   value is passed to ``remember``, the generated cookie will have a
3703   corresponding Max-Age value.
3704
3705 Documentation
3706 -------------
3707
3708 - Add information to the URL Dispatch narrative documentation about
3709   path pattern matching syntax.
3710
3711 Bug Fixes
3712 ---------
3713
3714 - Make ``route_url`` URL-quote segment replacements during generation.
3715   Remainder segments are not quoted.
3716
3717 1.0a3 (2009-06-24)
3718 ==================
3719
3720 Implementation Changes
3721 ----------------------
3722
3723 - ``repoze.bfg`` no longer relies on the Routes package to interpret
3724   URL paths.  All known existing ``path`` patterns will continue to
3725   work with the reimplemented logic, which lives in
3726   ``repoze.bfg.urldispatch``.  ``<route>`` ZCML directives which use
3727   certain attributes (uncommon ones) may not work (see "Backwards
3728   Incompatibilities" below).
3729
3730 Bug Fixes
3731 ---------
3732
3733 - ``model_url`` when passed a request that was generated as a result
3734   of a route match would fail in a call to ``route.generate``.
3735
3736 - BFG-on-GAE didn't work due to a corner case bug in the fallback
3737   Python implementation of ``threading.local`` (symptom:
3738   "Initialization arguments are not supported").  Thanks to Michael
3739   Bernstein for the bug report.
3740
3741 Documentation
3742 -------------
3743
3744 - Added a "corner case" explanation to the "Hybrid Apps" chapter
3745   explaining what to do when "the wrong" view is matched.
3746
3747 - Use ``repoze.bfg.url.route_url`` API in tutorials rather than Routes
3748   ``url_for`` API.
3749
3750 Features
3751 --------
3752
3753 - Added the ``repoze.bfg.url.route_url`` API.  This API allows you to
3754   generate URLs based on ``<route>`` declarations.  See the URL
3755   Dispatch narrative chapter and the "repoze.bfg.url" module API
3756   documentation for more information.
3757
3758 Backwards Incompatibilities
3759 ---------------------------
3760
3761 - As a result of disusing Routes, using the Routes ``url_for`` API
3762   inside a BFG application (as was suggested by previous iterations of
3763   tutorials) will no longer work.  Use the
3764   ``repoze.bfg.url.route_url`` method instead.
3765
3766 - The following attributes on the ``<route>`` ZCML directive no longer
3767   work: ``encoding``, ``static``, ``filter``, ``condition_method``,
3768   ``condition_subdomain``, ``condition_function``, ``explicit``, or
3769   ``subdomains``.  These were all Routes features.
3770
3771 - The ``<route>`` ZCML directive no longer supports the
3772   ``<requirement>`` subdirective.  This was a Routes feature.
3773
3774 1.0a2 (2009-06-23)
3775 ==================
3776
3777 Bug Fixes
3778 ---------
3779
3780 - The ``bfg_routesalchemy`` paster template app tests failed due to a
3781   mismatch between test and view signatures.
3782
3783 Features
3784 --------
3785
3786 - Add a ``view_for`` attribute to the ``route`` ZCML directive.  This
3787   attribute should refer to an interface or a class (ala the ``for``
3788   attribute of the ``view`` ZCML directive).
3789
3790 Documentation
3791 -------------
3792
3793 - Conditional documentation in installation section ("how to install a
3794   Python interpreter").
3795
3796 Backwards Incompatibilities
3797 ---------------------------
3798
3799 - The ``callback`` argument of the ``repoze.bfg.authentication``
3800   authentication policies named ``RepozeWho1AuthenticationPolicy``,
3801   ``RemoteUserAuthenticationPolicy``, and
3802   ``AuthTktAuthenticationPolicy`` now must accept two positional
3803   arguments: the orginal argument accepted by each (userid or
3804   identity) plus a second argument, which will be the current request.
3805   Apologies, this is required to service finding groups when there is
3806   no "global" database connection.
3807
3808 1.0a1 (2009-06-22)
3809 ==================
3810
3811 Features
3812 --------
3813
3814 - A new ZCML directive was added named ``notfound``.  This ZCML
3815   directive can be used to name a view that should be invoked when the
3816   request can't otherwise be resolved to a view callable.  For example::
3817
3818     <notfound 
3819         view="helloworld.views.notfound_view"/>
3820
3821 - A new ZCML directive was added named ``forbidden``.  This ZCML
3822   directive can be used to name a view that should be invoked when a
3823   view callable for a request is found, but cannot be invoked due to
3824   an authorization failure.  For example::
3825
3826    <forbidden
3827        view="helloworld.views.forbidden_view"/>
3828
3829 - Allow views to be *optionally* defined as callables that accept only
3830   a request object, instead of both a context and a request (which
3831   still works, and always will).  The following types work as views in
3832   this style:
3833
3834   - functions that accept a single argument ``request``, e.g.::
3835
3836       def aview(request):
3837           pass
3838
3839   - new and old-style classes that have an ``__init__`` method that
3840     accepts ``self, request``, e.g.::
3841
3842       def View(object):
3843           __init__(self, request):
3844              pass
3845
3846   - Arbitrary callables that have a ``__call__`` method that accepts
3847     ``self, request``, e.g.::
3848
3849       def AView(object):
3850           def __call__(self, request):
3851              pass
3852       view = AView()
3853
3854   This likely should have been the calling convention all along, as
3855   the request has ``context`` as an attribute already, and with views
3856   called as a result of URL dispatch, having the context in the
3857   arguments is not very useful.  C'est la vie.
3858
3859 - Cache the absolute path in the caller's package globals within
3860   ``repoze.bfg.path`` to get rid of repeated (expensive) calls to
3861   os.path.abspath.
3862
3863 - Add ``reissue_time`` and ``timeout`` parameters to
3864   ``repoze.bfg.authentication.AuthTktAuthenticationPolicy``
3865   constructor.  If these are passed, cookies will be reset every so
3866   often (cadged from the same change to repoze.who lately).
3867
3868 - The matchdict related to the matching of a Routes route is available
3869   on the request as the ``matchdict`` attribute:
3870   ``request.matchdict``.  If no route matched, this attribute will be
3871   None.
3872
3873 - Make 404 responses slightly cheaper by showing
3874   ``environ["PATH_INFO"]`` on the notfound result page rather than the
3875   fullly computed URL.
3876
3877 - Move LRU cache implementation into a separate package
3878   (``repoze.lru``).
3879
3880 - The concepts of traversal and URL dispatch have been unified.  It is
3881   now possible to use the same sort of factory as both a traversal
3882   "root factory" and what used to be referred to as a urldispatch
3883   "context factory".
3884
3885 - When the root factory argument (as a first argument) passed to
3886   ``repoze.bfg.router.make_app`` is ``None``, a *default* root factory
3887   is used.  This is in support of using routes as "root finders"; it
3888   supplants the idea that there is a default
3889   ``IRoutesContextFactory``.
3890
3891 - The `view`` ZCML statement and the ``repoze.bfg.view.bfg_view``
3892   decorator now accept an extra argument: ``route_name``.  If a
3893   ``route_name`` is specified, it must match the name of a previously
3894   defined ``route`` statement.  When it is specified, the view will
3895   only be called when that route matches during a request.
3896
3897 - It is now possible to perfom traversal *after* a route has matched.
3898   Use the pattern ``*traverse`` in a ``<route>`` ``path`` attribute
3899   within ZCML, and the path remainder which it matches will be used as
3900   a traversal path.
3901
3902 - When any route defined matches, the WSGI environment will now
3903   contain a key ``bfg.routes.route`` (the Route object which matched),
3904   and a key ``bfg.routes.matchdict`` (the result of calling route.match).
3905
3906 Deprecations
3907 ------------
3908
3909 - Utility registrations against
3910   ``repoze.bfg.interfaces.INotFoundView`` and
3911   ``repoze.bfg.interfaces.IForbiddenView`` are now deprecated.  Use
3912   the ``notfound`` and ``forbidden`` ZCML directives instead (see the
3913   "Hooks" chapter for more information).  Such registrations will
3914   continue to work, but the notfound and forbidden directives do
3915   "extra work" to ensure that the callable named by the directive can
3916   be called by the router even if it's a class or
3917   request-argument-only view.
3918
3919 Removals
3920 --------
3921
3922 - The ``IRoutesContext``, ``IRoutesContextFactory``, and
3923   ``IContextNotFound`` interfaces were removed from
3924   ``repoze.bfg.interfaces``.  These were never APIs.
3925
3926 - The ``repoze.bfg.urldispatch.RoutesContextNotFound``,
3927   ``repoze.bfg.urldispatch.RoutesModelTraverser`` and
3928   ``repoze.bfg.urldispatch.RoutesContextURL`` classes were removed.
3929   These were also never APIs.
3930
3931 Backwards Incompatibilities
3932 ---------------------------
3933
3934 - Moved the ``repoze.bfg.push`` module, which implemented the ``pushpage``
3935   decorator, into a separate distribution, ``repoze.bfg.pushpage``.
3936   Applications which used this decorator should continue to work after
3937   adding that distribution to their installation requirements.
3938
3939 - Changing the default request factory via an IRequestFactory utility
3940   registration (as used to be documented in the "Hooks" chapter's
3941   "Changing the request factory" section) is no longer supported.  The
3942   dance to manufacture a request is complicated as a result of
3943   unifying traversal and url dispatch, making it highly unlikely for
3944   anyone to be able to override it properly.  For those who just want
3945   to decorate or modify a request, use a NewRequestEvent subscriber
3946   (see the Events chapter in the documentation).
3947
3948 - The ``repoze.bfg.IRequestFactory`` interface was removed.  See the
3949   bullet above for why.
3950
3951 - Routes "context factories" (spelled as the factory argument to a
3952   route statement in ZCML) must now expect the WSGI environ as a
3953   single argument rather than a set of keyword arguments.  They can
3954   obtain the match dictionary by asking for
3955   environ['bfg.routes.matchdict'].  This is the same set of keywords
3956   that used to be passed to urldispatch "context factories" in BFG 0.9
3957   and below.
3958
3959 - Using the ``@zope.component.adapter`` decorator on a bfg view
3960   function no longer works.  Use the ``@repoze.bfg.view.bfg_view``
3961   decorator instead to mark a function (or a class) as a view.
3962
3963 - The name under which the matching route object is found in the
3964   environ was changed from ``bfg.route`` to ``bfg.routes.route``.
3965
3966 - Finding the root is now done *before* manufacturing a request object
3967   (and sending a new request event) within the router (it used to be
3968   performed afterwards).
3969
3970 - Adding ``*path_info`` to a route no longer changes the PATH_INFO for
3971   a request that matches using URL dispatch.  This feature was only
3972   there to service the ``repoze.bfg.wsgi.wsgiapp2`` decorator and it
3973   did it wrong; use ``*subpath`` instead now.
3974
3975 - The values of ``subpath``, ``traversed``, and ``virtual_root_path``
3976   attached to the request object are always now tuples instead of
3977   lists (performance).
3978
3979 Bug Fixes
3980 ---------
3981
3982 - The ``bfg_alchemy`` Paster template named "repoze.tm" in its
3983   pipeline rather than "repoze.tm2", causing the startup to fail.
3984
3985 - Move BBB logic for registering an
3986   IAuthenticationPolicy/IForbiddenView/INotFoundView based on older
3987   concepts from the router module's ``make_app`` function into the
3988   ``repoze.bfg.zcml.zcml_configure`` callable, to service
3989   compatibility with scripts that use "zope.configuration.xmlconfig"
3990   (replace with ``repoze.bfg.zml.zcml_configure`` as necessary to get
3991   BBB logic)
3992
3993 Documentation
3994 -------------
3995
3996 - Add interface docs related to how to create authentication policies
3997   and authorization policies to the "Security" narrative chapter.
3998
3999 - Added a (fairly sad) "Combining Traversal and URL Dispatch" chapter
4000   to the narrative documentation.  This explains the usage of
4001   ``*traverse`` and ``*subpath`` in routes URL patters.
4002
4003 - A "router" chapter explaining the request/response lifecycle at a
4004   high level was added.
4005
4006 - Replaced all mentions and explanations of a routes "context factory"
4007   with equivalent explanations of a "root factory" (context factories
4008   have been disused).
4009
4010 - Updated Routes bfgwiki2 tutorial to reflect the fact that context
4011   factories are now no longer used.
4012
4013 0.9.1 (2009-06-02)
4014 ==================
4015
4016 Features
4017 --------
4018
4019 - Add API named ``repoze.bfg.settings.get_settings`` which retrieves a
4020   derivation of values passed as the ``options`` value of
4021   ``repoze.bfg.router.make_app``.  This API should be preferred
4022   instead of using getUtility(ISettings).  I added a new
4023   ``repoze.bfg.settings`` API document as well.
4024
4025 Bug Fixes
4026 ---------
4027
4028 - Restored missing entry point declaration for bfg_alchemy paster
4029   template, which was accidentally removed in 0.9.
4030
4031 Documentation
4032 -------------
4033
4034 - Fix a reference to ``wsgiapp`` in the ``wsgiapp2`` API documentation
4035   within the ``repoze.bfg.wsgi`` module.
4036
4037 API Removals
4038 ------------
4039
4040 - The ``repoze.bfg.location.locate`` API was removed: it didn't do
4041   enough to be very helpful and had a misleading name.
4042
4043 0.9 (2009-06-01)
4044 ================
4045
4046 Bug Fixes
4047 ---------
4048
4049 - It was not possible to register a custom ``IRoutesContextFactory``
4050   for use as a default context factory as documented in the "Hooks"
4051   chapter.
4052
4053 Features
4054 --------
4055
4056 - The ``request_type`` argument of ZCML ``view`` declarations and
4057   ``bfg_view`` decorators can now be one of the strings ``GET``,
4058   ``POST``, ``PUT``, ``DELETE``, or ``HEAD`` instead of a reference to
4059   the respective interface type imported from
4060   ``repoze.bfg.interfaces``.
4061
4062 - The ``route`` ZCML directive now accepts ``request_type`` as an
4063   alias for its ``condition_method`` argument for symmetry with the
4064   ``view`` directive.
4065
4066 - The ``bfg_routesalchemy`` paster template now provides a unit test
4067   and actually uses the database during a view rendering.
4068
4069 Removals
4070 --------
4071
4072 - Remove ``repoze.bfg.threadlocal.setManager``.  It was only used in
4073   unit tests.
4074
4075 - Remove ``repoze.bfg.wsgi.HTTPException``,
4076   ``repoze.bfg.wsgi.NotFound``, and ``repoze.bfg.wsgi.Unauthorized``.
4077   These classes were disused with the introduction of the
4078   ``IUnauthorizedView`` and ``INotFoundView`` machinery.
4079
4080 Documentation
4081 -------------
4082
4083 - Add description to narrative templating chapter about how to use
4084   Chameleon text templates.
4085
4086 - Changed Views narrative chapter to use method strings rather than
4087   interface types, and moved advanced interface type usage to Events
4088   narrative chapter.
4089
4090 - Added a Routes+SQLAlchemy wiki tutorial.
4091
4092 0.9a8 (2009-05-31)
4093 ==================
4094
4095 Features
4096 --------
4097
4098 - It is now possible to register a custom
4099   ``repoze.bfg.interfaces.INotFoundView`` for a given application.
4100   This feature replaces the
4101   ``repoze.bfg.interfaces.INotFoundAppFactory`` feature previously
4102   described in the Hooks chapter.  The INotFoundView will be called
4103   when the framework detects that a view lookup done as a result of a
4104   request fails; it should accept a context object and a request
4105   object; it should return an IResponse object (a webob response,
4106   basically).  See the Hooks narrative chapter of the BFG docs for
4107   more info.
4108
4109 - The error presented when a view invoked by the router returns a
4110   non-response object now includes the view's name for troubleshooting
4111   purposes.
4112
4113 Bug Fixes
4114 ---------
4115
4116 - A "new response" event is emitted for forbidden and notfound views.
4117
4118 Deprecations
4119 ------------
4120
4121 - The ``repoze.bfg.interfaces.INotFoundAppFactory`` interface has been
4122   deprecated in favor of using the new
4123   ``repoze.bfg.interfaces.INotFoundView`` mechanism.
4124
4125 Renames
4126 -------
4127
4128 - Renamed ``repoze.bfg.interfaces.IForbiddenResponseFactory`` to
4129   ``repoze.bfg.interfaces.IForbiddenView``.
4130
4131 0.9a7 (2009-05-30)
4132 ==================
4133
4134 Features
4135 --------
4136
4137 - Remove "context" argument from ``effective_principals`` and
4138   ``authenticated_userid`` function APIs in ``repoze.bfg.security``,
4139   effectively a doing reversion to 0.8 and before behavior.  Both
4140   functions now again accept only the ``request`` parameter.
4141
4142 0.9a6 (2009-05-29)
4143 ==================
4144
4145 Documentation
4146 -------------
4147
4148 - Changed "BFG Wiki" tutorial to use AuthTktAuthenticationPolicy
4149   rather than repoze.who.
4150
4151 Features
4152 --------
4153
4154 - Add an AuthTktAuthenticationPolicy.  This policy retrieves
4155   credentials from an auth_tkt cookie managed by the application
4156   itself (instead of relying on an upstream data source for
4157   authentication data).  See the Security API chapter of the
4158   documentation for more info.
4159
4160 - Allow RemoteUserAuthenticationPolicy and
4161   RepozeWho1AuthenticationPolicy to accept various constructor
4162   arguments.  See the Security API chapter of the documentation for
4163   more info.
4164
4165 0.9a5 (2009-05-28)
4166 ==================
4167
4168 Features
4169 --------
4170
4171 - Add a ``get_app`` API functions to the ``paster`` module.  This
4172   obtains a WSGI application from a config file given a config file
4173   name and a section name.  See the ``repoze.bfg.paster`` API docs for
4174   more information.
4175
4176 - Add a new module named ``scripting``.  It contains a ``get_root``
4177   API function, which, provided a Router instance, returns a traversal
4178   root object and a "closer".  See the ``repoze.bfg.scripting`` API
4179   docs for more info.
4180
4181 0.9a4 (2009-05-27)
4182 ==================
4183
4184 Bug Fixes
4185 ---------
4186
4187 - Try checking for an "old style" security policy *after* we parse
4188   ZCML (thinko).
4189
4190 0.9a3 (2009-05-27)
4191 ==================
4192
4193 Features
4194 --------
4195
4196 - Allow IAuthenticationPolicy and IAuthorizationPolicy to be
4197   overridden via ZCML registrations (do ZCML parsing after
4198   registering these in router.py).
4199
4200 Documentation
4201 -------------
4202
4203 - Added "BFG Wiki" tutorial to documentation; it describes
4204   step-by-step how to create a traversal-based ZODB application with
4205   authentication.
4206
4207 Deprecations
4208 ------------
4209
4210 - Added deprecations for imports of ``ACLSecurityPolicy``,
4211   ``InheritingACLSecurityPolicy``, ``RemoteUserACLSecurityPolicy``,
4212   ``RemoteUserInheritingACLSecurityPolicy``, ``WhoACLSecurityPolicy``,
4213   and ``WhoInheritingACLSecurityPolicy`` from the
4214   ``repoze.bfg.security`` module; for the meantime (for backwards
4215   compatibility purposes) these live in the ``repoze.bfg.secpols``
4216   module.  Note however, that the entire concept of a "security
4217   policy" is deprecated in BFG in favor of separate authentication and
4218   authorization policies, so any use of a security policy will
4219   generate additional deprecation warnings even if you do start using
4220   ``repoze.bfg.secpols``.  ``repoze.bfg.secpols`` will disappear in a
4221   future release of ``repoze.bfg``.
4222
4223 Deprecated Import Alias Removals
4224 --------------------------------
4225
4226 - Remove ``repoze.bfg.template`` module.  All imports from this
4227   package have been deprecated since 0.3.8.  Instead, import
4228   ``get_template``, ``render_template``, and
4229   ``render_template_to_response`` from the
4230   ``repoze.bfg.chameleon_zpt`` module. 
4231
4232 - Remove backwards compatibility import alias for
4233   ``repoze.bfg.traversal.split_path`` (deprecated since 0.6.5).  This
4234   must now be imported as ``repoze.bfg.traversal.traversal_path``).
4235
4236 - Remove backwards compatibility import alias for
4237   ``repoze.bfg.urldispatch.RoutesContext`` (deprecated since 0.6.5).
4238   This must now be imported as
4239   ``repoze.bfg.urldispatch.DefaultRoutesContext``.
4240
4241 - Removed backwards compatibility import aliases for
4242   ``repoze.bfg.router.get_options`` and ``repoze.bfg.router.Settings``
4243   (deprecated since 0.6.2).  These both must now be imported from
4244   ``repoze.bfg.settings``.
4245
4246 - Removed backwards compatibility import alias for
4247   ``repoze.bfg.interfaces.IRootPolicy`` (deprecated since 0.6.2).  It
4248   must be imported as ``repoze.bfg.interfaces.IRootFactory`` now.
4249
4250 - Removed backwards compatibility import alias for
4251   ``repoze.bfg.interfaces.ITemplate`` (deprecated since 0.4.4).  It
4252   must be imported as ``repoze.bfg.interfaces.ITemplateRenderer`` now.
4253
4254 - Removed backwards compatibility import alias for
4255   ``repoze.bfg.interfaces.ITemplateFactory`` (deprecated since 0.4.4).
4256   It must be imported as
4257   ``repoze.bfg.interfaces.ITemplateRendererFactory`` now.
4258
4259 - Removed backwards compatibility import alias for
4260   ``repoze.bfg.chameleon_zpt.ZPTTemplateFactory`` (deprecated since
4261   0.4.4).  This must be imported as ``repoze.bfg.ZPTTemplateRenderer``
4262   now.
4263
4264 0.9a2 (2009-05-27)
4265 ==================
4266
4267 Features
4268 --------
4269
4270 - A paster command has been added named "bfgshell".  This command can
4271   be used to get an interactive prompt with your BFG root object in
4272   the global namespace.  E.g.::
4273
4274     bin/paster bfgshell /path/to/myapp.ini myapp
4275
4276   See the ``Project`` chapter in the BFG documentation for more
4277   information.
4278
4279 Deprecations
4280 ------------
4281
4282 - The name ``repoze.bfg.registry.registry_manager`` was never an API,
4283   but scripts in the wild were using it to set up an environment for
4284   use under a debug shell.  A backwards compatibility shim has been
4285   added for this purpose, but the feature is deprecated.
4286
4287 0.9a1 (2009-5-27)
4288 =================
4289
4290 Features
4291 --------
4292
4293 - New API functions named ``forget`` and ``remember`` are available in
4294   the ``security`` module.  The ``forget`` function returns headers
4295   which will cause the currently authenticated user to be logged out
4296   when set in a response.  The ``remember`` function (when passed the
4297   proper arguments) will return headers which will cause a principal
4298   to be "logged in" when set in a response.  See the Security API
4299   chapter of the docs for more info.
4300
4301 - New keyword arguments to the ``repoze.bfg.router.make_app`` call
4302   have been added: ``authentication_policy`` and
4303   ``authorization_policy``.  These should, respectively, be an
4304   implementation of an authentication policy (an object implementing
4305   the ``repoze.bfg.interfaces.IAuthenticationPolicy`` interface) and
4306   an implementation of an authorization policy (an object implementing
4307   ``repoze.bfg.interfaces.IAuthorizationPolicy)``.  Concrete
4308   implementations of authentication policies exist in
4309   ``repoze.bfg.authentication``.  Concrete implementations of
4310   authorization policies exist in ``repoze.bfg.authorization``.
4311
4312   Both ``authentication_policy`` and ``authorization_policy`` default
4313   to ``None``.
4314
4315   If ``authentication_policy`` is ``None``, but
4316   ``authorization_policy`` is *not* ``None``, then
4317   ``authorization_policy`` is ignored (the ability to do authorization
4318   depends on authentication).
4319
4320   If the ``authentication_policy`` argument is *not* ``None``, and the
4321   ``authorization_policy`` argument *is* ``None``, the authorization
4322   policy defaults to an authorization implementation that uses ACLs
4323   (``repoze.bfg.authorization.ACLAuthorizationPolicy``).
4324
4325   We no longer encourage configuration of "security policies" using
4326   ZCML, as previously we did for ``ISecurityPolicy``.  This is because
4327   it's not uncommon to need to configure settings for concrete
4328   authorization or authentication policies using paste .ini
4329   parameters; the app entry point for your application is the natural
4330   place to do this.
4331
4332 - Two new abstractions have been added in the way of adapters used by
4333   the system: an ``IAuthorizationPolicy`` and an
4334   ``IAuthenticationPolicy``.  A combination of these (as registered by
4335   the ``securitypolicy`` ZCML directive) take the place of the
4336   ``ISecurityPolicy`` abstraction in previous releases of repoze.who.
4337   The API functions in ``repoze.who.security`` (such as
4338   ``authentication_userid``, ``effective_principals``,
4339   ``has_permission``, and so on) have been changed to try to make use
4340   of these new adapters.  If you're using an older ``ISecurityPolicy``
4341   adapter, the system will still work, but it will print deprecation
4342   warnings when such a policy is used.
4343
4344 - The way the (internal) IViewPermission utilities registered via ZCML
4345   are invoked has changed.  They are purely adapters now, returning a
4346   boolean result, rather than returning a callable. You shouldn't have
4347   been using these anyway. ;-)
4348
4349 - New concrete implementations of IAuthenticationPolicy have been
4350   added to the ``repoze.bfg.authentication`` module:
4351   ``RepozeWho1AuthenticationPolicy`` which uses ``repoze.who``
4352   identity to retrieve authentication data from and
4353   ``RemoteUserAuthenticationPolicy``, which uses the ``REMOTE_USER``
4354   value in the WSGI environment to retrieve authentication data.
4355
4356 - A new concrete implementation of IAuthorizationPolicy has been added
4357   to the ``repoze.bfg.authorization`` module:
4358   ``ACLAuthorizationPolicy`` which uses ACL inheritance to do
4359   authorization.
4360
4361 - It is now possible to register a custom
4362   ``repoze.bfg.interfaces.IForbiddenResponseFactory`` for a given
4363   application.  This feature replaces the
4364   ``repoze.bfg.interfaces.IUnauthorizedAppFactory`` feature previously
4365   described in the Hooks chapter.  The IForbiddenResponseFactory will
4366   be called when the framework detects an authorization failure; it
4367   should accept a context object and a request object; it should
4368   return an IResponse object (a webob response, basically).  Read the
4369   below point for more info and see the Hooks narrative chapter of the
4370   BFG docs for more info.
4371
4372 Backwards Incompatibilities
4373 ---------------------------
4374
4375 - Custom NotFound and Forbidden (nee' Unauthorized) WSGI applications
4376   (registered as a utility for INotFoundAppFactory and
4377   IUnauthorizedAppFactory) could rely on an environment key named
4378   ``message`` describing the circumstance of the response.  This key
4379   has been renamed to ``repoze.bfg.message`` (as per the WSGI spec,
4380   which requires environment extensions to contain dots).
4381
4382 Deprecations
4383 ------------
4384
4385 - The ``repoze.bfg.interfaces.IUnauthorizedAppFactory`` interface has
4386   been deprecated in favor of using the new
4387   ``repoze.bfg.interfaces.IForbiddenResponseFactory`` mechanism.
4388
4389 - The ``view_execution_permitted`` API should now be imported from the
4390   ``repoze.bfg.security`` module instead of the ``repoze.bfg.view``
4391   module.
4392
4393 - The ``authenticated_userid`` and ``effective_principals`` APIs in
4394   ``repoze.bfg.security`` used to only take a single argument
4395   (request).  They now accept two arguments (``context`` and
4396   ``request``).  Calling them with a single argument is still
4397   supported but issues a deprecation warning.  (NOTE: this change was
4398   reverted in 0.9a7; meaning the 0.9 versions of these functions
4399   again accept ``request`` only, just like 0.8 and before).
4400
4401 - Use of "old-style" security policies (those base on ISecurityPolicy)
4402   is now deprecated.  See the "Security" chapter of the docs for info
4403   about activating an authorization policy and an authentication poicy.
4404
4405 0.8.1 (2009-05-21)
4406 ==================
4407
4408 Features
4409 --------
4410
4411 - Class objects may now be used as view callables (both via ZCML and
4412   via use of the ``bfg_view`` decorator in Python 2.6 as a class
4413   decorator).  The calling semantics when using a class as a view
4414   callable is similar to that of using a class as a Zope "browser
4415   view": the class' ``__init__`` must accept two positional parameters
4416   (conventionally named ``context``, and ``request``).  The resulting
4417   instance must be callable (it must have a ``__call__`` method).
4418   When called, the instance should return a response.  For example::
4419
4420     from webob import Response
4421
4422     class MyView(object):
4423         def __init__(self, context, request):
4424             self.context = context
4425             self.request = request
4426
4427         def __call__(self):
4428             return Response('hello from %s!' % self.context)
4429
4430    See the "Views" chapter in the documentation and the
4431    ``repoze.bfg.view`` API documentation for more information.
4432
4433 - Removed the pickling of ZCML actions (the code that wrote
4434   ``configure.zcml.cache`` next to ``configure.zcml`` files in
4435   projects).  The code which managed writing and reading of the cache
4436   file was a source of subtle bugs when users switched between
4437   imperative (e.g. ``@bfg_view``) registrations and declarative
4438   registrations (e.g. the ``view`` directive in ZCML) on the same
4439   project. On a moderately-sized project (535 ZCML actions and 15 ZCML
4440   files), executing actions read from the pickle was saving us only
4441   about 200ms (2.5 sec vs 2.7 sec average). On very small projects (1
4442   ZCML file and 4 actions), startup time was comparable, and sometimes
4443   even slower when reading from the pickle, and both ways were so fast
4444   that it really just didn't matter anyway.
4445
4446 0.8 (2009-05-18)
4447 ================
4448
4449 Features
4450 --------
4451
4452 - Added a ``traverse`` function to the ``repoze.bfg.traversal``
4453   module.  This function may be used to retrieve certain values
4454   computed during path resolution.  See the Traversal API chapter of
4455   the documentation for more information about this function.
4456
4457 Deprecations
4458 ------------
4459
4460 - Internal: ``ITraverser`` callables should now return a dictionary
4461   rather than a tuple.  Up until 0.7.0, all ITraversers were assumed
4462   to return a 3-tuple.  In 0.7.1, ITraversers were assumed to return a
4463   6-tuple.  As (by evidence) it's likely we'll need to add further
4464   information to the return value of an ITraverser callable, 0.8
4465   assumes that an ITraverser return a dictionary with certain elements
4466   in it.  See the ``repoze.bfg.interfaces.ITraverser`` interface for
4467   the list of keys that should be present in the dictionary.
4468   ``ITraversers`` which return tuples will still work, although a
4469   deprecation warning will be issued.
4470
4471 Backwards Incompatibilities
4472 ---------------------------
4473
4474 - If your code used the ITraverser interface directly (not via an API
4475   function such as ``find_model``) via an adapter lookup, you'll need
4476   to change your code to expect a dictionary rather than a 3- or
4477   6-tuple if your code ever gets return values from the default
4478   ModelGraphTraverser or RoutesModelTraverser adapters.
4479
4480 0.8a7 (2009-05-16)
4481 ==================
4482
4483 Backwards Incompatibilities
4484 ---------------------------
4485
4486 - The ``RoutesMapper`` class in ``repoze.bfg.urldispatch`` has been
4487   removed, as well as its documentation.  It had been deprecated since
4488   0.6.3.  Code in ``repoze.bfg.urldispatch.RoutesModelTraverser``
4489   which catered to it has also been removed.
4490
4491 - The semantics of the ``route`` ZCML directive have been simplified.
4492   Previously, it was assumed that to use a route, you wanted to map a
4493   route to an externally registered view.  The new ``route`` directive
4494   instead has a ``view`` attribute which is required, specifying the
4495   dotted path to a view callable.  When a route directive is
4496   processed, a view is *registered* using the name attribute of the
4497   route directive as its name and the callable as its value.  The
4498   ``view_name`` and ``provides`` attributes of the ``route`` directive
4499   are therefore no longer used.  Effectively, if you were previously
4500   using the ``route`` directive, it means you must change a pair of
4501   ZCML directives that look like this::
4502
4503     <route
4504        name="home"
4505        path=""
4506        view_name="login"
4507        factory=".models.root.Root"
4508      />
4509
4510     <view
4511        for=".models.root.Root"
4512        name="login"
4513        view=".views.login_view"
4514      />
4515     
4516   To a ZCML directive that looks like this::
4517
4518     <route
4519        name="home"
4520        path=""
4521        view=".views.login_view"
4522        factory=".models.root.Root"
4523      />
4524
4525   In other words, to make old code work, remove the ``view``
4526   directives that were only there to serve the purpose of backing
4527   ``route`` directives, and move their ``view=`` attribute into the
4528   ``route`` directive itself.
4529
4530   This change also necessitated that the ``name`` attribute of the
4531   ``route`` directive is now required.  If you were previously using
4532   ``route`` directives without a ``name`` attribute, you'll need to
4533   add one (the name is arbitrary, but must be unique among all
4534   ``route`` and ``view`` statements).
4535
4536   The ``provides`` attribute of the ``route`` directive has also been
4537   removed.  This directive specified a sequence of interface types
4538   that the generated context would be decorated with.  Since route
4539   views are always generated now for a single interface
4540   (``repoze.bfg.IRoutesContext``) as opposed to being looked up
4541   arbitrarily, there is no need to decorate any context to ensure a
4542   view is found.
4543
4544 Documentation
4545 -------------
4546
4547 - Added API docs for the ``repoze.bfg.testing`` methods
4548   ``registerAdapter``, ``registerUtiity``, ``registerSubscriber``, and
4549   ``cleanUp``.
4550
4551 - Added glossary entry for "root factory".
4552
4553 - Noted existence of ``repoze.bfg.pagetemplate`` template bindings in
4554   "Available Add On Template System Bindings" in Templates chapter in
4555   narrative docs.
4556
4557 - Update "Templates" narrative chapter in docs (expand to show a
4558   sample template and correct macro example).
4559
4560 Features
4561 --------
4562
4563 - Courtesty Carlos de la Guardia, added an ``alchemy`` Paster
4564   template.  This paster template sets up a BFG project that uses
4565   SQAlchemy (with SQLite) and uses traversal to resolve URLs.  (no
4566   Routes areused).  This template can be used via ``paster create -t
4567   bfg_alchemy``.
4568
4569 - The Routes ``Route`` object used to resolve the match is now put
4570   into the environment as ``bfg.route`` when URL dispatch is used.
4571
4572 - You can now change the default Routes "context factory" globally.
4573   See the "ZCML Hooks" chapter of the documentation (in the "Changing
4574   the Default Routes Context Factory" section).
4575
4576 0.8a6 (2009-05-11)
4577 ==================
4578
4579 Features
4580 --------
4581
4582 - Added a ``routesalchemy`` Paster template.  This paster template
4583   sets up a BFG project that uses SQAlchemy (with SQLite) and uses
4584   Routes exclusively to resolve URLs (no traversal root factory is
4585   used).  This template can be used via ``paster create -t
4586   bfg_routesalchemy``.
4587
4588 Documentation
4589 -------------
4590
4591 - Added documentation to the URL Dispatch chapter about how to catch
4592   the root URL using a ZCML ``route`` directive.
4593
4594 - Added documentation to the URL Dispatch chapter about how to perform
4595   a cleanup function at the end of a request (e.g. close the SQL
4596   connection).
4597
4598 Bug Fixes
4599 ---------
4600
4601 - In version 0.6.3, passing a ``get_root`` callback (a "root factory")
4602   to ``repoze.bfg.router.make_app`` became optional if any ``route``
4603   declaration was made in ZCML.  The intent was to make it possible to
4604   disuse traversal entirely, instead relying entirely on URL dispatch
4605   (Routes) to resolve all contexts.  However a compound set of bugs
4606   prevented usage of a Routes-based root view (a view which responds
4607   to "/").  One bug existed in `repoze.bfg.urldispatch``, another
4608   existed in Routes itself.
4609
4610   To resolve this issue, the urldispatch module was fixed, and a fork
4611   of the Routes trunk was put into the "dev" index named
2d29f1 4612   ``Routes-1.11dev-chrism-home``.  The source for the fork exists at
TL 4613   `http://bitbucket.org/chrism/routes-home/
4614   <http://bitbucket.org/chrism/routes-home/>`_ (broken link);
4615   its contents have been merged into the Routes trunk
4616   (what will be Routes 1.11).
b7c935 4617
CM 4618 0.8a5 (2009-05-08)
4619 ==================
4620
4621 Features
4622 --------
4623
4624 - Two new security policies were added:
4625   RemoteUserInheritingACLSecurityPolicy and
4626   WhoInheritingACLSecurityPolicy.  These are security policies which
4627   take into account *all* ACLs defined in the lineage of a context
4628   rather than stopping at the first ACL found in a lineage.  See the
4629   "Security" chapter of the API documentation for more information.
4630
4631 - The API and narrative documentation dealing with security was
4632   changed to introduce the new "inheriting" security policy variants.
4633
4634 - Added glossary entry for "lineage".
4635
4636 Deprecations
4637 ------------
4638
4639 - The security policy previously named
4640   ``RepozeWhoIdentityACLSecurityPolicy`` now has the slightly saner
4641   name of ``WhoACLSecurityPolicy``.  A deprecation warning is emitted
4642   when this policy is imported under the "old" name; usually this is
4643   due to its use in ZCML within your application.  If you're getting
4644   this deprecation warning, change your ZCML to use the new name,
4645   e.g. change::
4646
4647    <utility
4648      provides="repoze.bfg.interfaces.ISecurityPolicy"
4649      factory="repoze.bfg.security.RepozeWhoIdentityACLSecurityPolicy"
4650      />
4651
4652   To::
4653
4654    <utility
4655      provides="repoze.bfg.interfaces.ISecurityPolicy"
4656      factory="repoze.bfg.security.WhoACLSecurityPolicy"
4657      />
4658
4659 0.8a4 (2009-05-04)
4660 ==================
4661
4662 Features
4663 --------
4664
4665 - ``zope.testing`` is no longer a direct dependency, although our
4666   dependencies (such as ``zope.interface``, ``repoze.zcml``, etc)
4667   still depend on it.
4668
4669 - Tested on Google App Engine.  Added a tutorial to the documentation
4670   explaining how to deploy a BFG app to GAE.
4671
4672 Backwards Incompatibilities
4673 ---------------------------
4674
4675 - Applications which rely on ``zope.testing.cleanup.cleanUp`` in unit
4676   tests can still use that function indefinitely.  However, for
4677   maximum forward compatibility, they should import ``cleanUp`` from
4678   ``repoze.bfg.testing`` instead of from ``zope.testing.cleanup``.
4679   The BFG paster templates and docs have been changed to use this
4680   function instead of the ``zope.testing.cleanup`` version.
4681
4682 0.8a3 (2009-05-03)
4683 ===================
4684
4685 Features
4686 --------
4687
4688 - Don't require a successful import of ``zope.testing`` at BFG
4689   application runtime.  This allows us to get rid of ``zope.testing``
4690   on platforms like GAE which have file limits.
4691
4692 0.8a2 (2009-05-02)
4693 ==================
4694
4695 Features
4696 --------
4697
4698 - We no longer include the ``configure.zcml`` of the ``chameleon.zpt``
4699   package within the ``configure.zcml`` of the "repoze.bfg.includes"
4700   package.  This has been a no-op for some time now.
4701
4702 - The ``repoze.bfg.chameleon_zpt`` package no longer imports from
4703   ``chameleon.zpt`` at module scope, deferring the import until later
4704   within a method call.  The ``chameleon.zpt`` package can't be
4705   imported on platforms like GAE.
4706
4707 0.8a1 (2009-05-02)
4708 ==================
4709
4710 Deprecation Warning and Import Alias Removals
4711 ---------------------------------------------
4712
4713 - Since version 0.6.1, a deprecation warning has been emitted when the
4714   name ``model_url`` is imported from the ``repoze.bfg.traversal``
4715   module.  This import alias (and the deprecation warning) has been
4716   removed.  Any import of the ``model_url`` function will now need to
4717   be done from ``repoze.bfg.url``; any import of the name
4718   ``model_url`` from ``repoze.bfg.traversal`` will now fail.  This was
4719   done to remove a dependency on zope.deferredimport.
4720
4721 - Since version 0.6.5, a deprecation warning has been emitted when the
4722   name ``RoutesModelTraverser`` is imported from the
4723   ``repoze.bfg.traversal`` module.  This import alias (and the
4724   deprecation warning) has been removed.  Any import of the
4725   ``RoutesModelTraverser`` class will now need to be done from
4726   ``repoze.bfg.urldispatch``; any import of the name
4727   ``RoutesModelTraverser`` from ``repoze.bfg.traversal`` will now
4728   fail.  This was done to remove a dependency on zope.deferredimport.
4729
4730 Features
4731 --------
4732
4733 - This release of ``repoze.bfg`` is "C-free".  This means it has no
4734   hard dependencies on any software that must be compiled from C
4735   source at installation time.  In particular, ``repoze.bfg`` no
4736   longer depends on the ``lxml`` package.
4737
4738   This change has introduced some backwards incompatibilities,
4739   described in the "Backwards Incompatibilities" section below.
4740
4741 - This release was tested on Windows XP.  It appears to work fine and
4742   all the tests pass.
4743
4744 Backwards Incompatibilities
4745 ---------------------------
4746
4747 Incompatibilities related to making ``repoze.bfg`` "C-free":
4748
4749 - Removed the ``repoze.bfg.chameleon_genshi`` module, and thus support
4750   for Genshi-style chameleon templates.  Genshi-style Chameleon
4751   templates depend upon ``lxml``, which is implemented in C (as
4752   opposed to pure Python) and the ``repoze.bfg`` core is "C-free" as
4753   of this release. You may get Genshi-style Chameleon support back by
4754   installing the ``repoze.bfg.chameleon_genshi`` package availalable
4755   from http://svn.repoze.org/repoze.bfg.chameleon_genshi (also
4756   available in the index at http://dist.repoze.org/bfg/0.8/simple).
4757   All existing code that depended on the ``chameleon_genshi`` module
4758   prior to this release of ``repoze.bfg`` should work without change
4759   after this addon is installed.
4760
4761 - Removed the ``repoze.bfg.xslt`` module and thus support for XSL
4762   templates.  The ``repoze.bfg.xslt`` module depended upon ``lxml``,
4763   which is implemented in C, and the ``repoze.bfg`` core is "C-free"
4764   as of this release.  You bay get XSL templating back by installing
4765   the ``repoze.bfg.xslt`` package available from
4766   http://svn.repoze.org/repoze.bfg.xslt/ (also available in the index
4767   at http://dist.repoze.org/bfg/0.8/simple).  All existing code that
4768   depended upon the ``xslt`` module prior to this release of
4769   ``repoze.bfg`` should work without modification after this addon is
4770   installed.
4771
4772 - Removed the ``repoze.bfg.interfaces.INodeTemplateRenderer``
4773   interface and the an old b/w compat aliases from that interface to
4774   ``repoze.bfg.interfaces.INodeTemplate``.  This interface must now be
4775   imported from the ``repoze.bfg.xslt.interfaces`` package after
4776   installation of the ``repoze.bfg.xslt`` addon package described
4777   above as ``repoze.bfg.interfaces.INodeTemplateRenderer``.  This
4778   interface was never part of any public API.
4779
4780 Other backwards incompatibilities:
4781
4782 - The ``render_template`` function in ``repoze.bfg.chameleon_zpt``
4783   returns Unicode instead of a string.  Likewise, the individual
4784   values returned by the iterable created by the
4785   ``render_template_to_iterable`` function are also each Unicode.
4786   This is actually a backwards incompatibility inherited from our new
4787   use of the combination of ``chameleon.core`` 1.0b32 (the
4788   non-lxml-depending version) and ``chameleon.zpt`` 1.0b16+ ; the
4789   ``chameleon.zpt`` PageTemplateFile implementation used to return a
4790   string, but now returns Unicode.
4791
4792 0.7.1 (2009-05-01)
4793 ==================
4794
4795 Index-Related
4796 -------------
4797
4798 - The canonical package index location for ``repoze.bfg`` has changed.
4799   The "old" index (http://dist.repoze.org/lemonade/dev/simple) has
4800   been superseded by a new index location
4801   (`http://dist.repoze.org/bfg/current/simple
4802   <http://dist.repoze.org/bfg/current/simple>`_).  The installation
4803   documentation has been updated as well as the ``setup.cfg`` file in
4804   this package.  The "lemonade" index still exists, but it is not
4805   guaranteed to have the latest BFG software in it, nor will it be
4806   maintained in the future.
4807
4808 Features
4809 --------
4810
4811 - The "paster create" templates have been modified to use links to the
4812   new "bfg.repoze.org" and "docs.repoze.org" websites.
4813
4814 - Added better documentation for virtual hosting at a URL prefix
4815   within the virtual hosting docs chapter.
4816
4817 - The interface for ``repoze.bfg.interfaces.ITraverser`` and the
4818   built-in implementations that implement the interface
4819   (``repoze.bfg.traversal.ModelGraphTraverser``, and
4820   ``repoze.bfg.urldispatch.RoutesModelTraverser``) now expect the
4821   ``__call__`` method of an ITraverser to return 3 additional
4822   arguments: ``traversed``, ``virtual_root``, and
4823   ``virtual_root_path`` (the old contract was that the ``__call__``
4824   method of an ITraverser returned; three arguments, the contract new
4825   is that it returns six).  ``traversed`` will be a sequence of
4826   Unicode names that were traversed (including the virtual root path,
4827   if any) or ``None`` if no traversal was performed, ``virtual_root``
4828   will be a model object representing the virtual root (or the
4829   physical root if traversal was not performed), and
4830   ``virtual_root_path`` will be a sequence representing the virtual
4831   root path (a sequence of Unicode names) or ``None`` if traversal was
4832   not performed.
4833
4834   Six arguments are now returned from BFG ITraversers.  They are
4835   returned in this order: ``context``, ``view_name``, ``subpath``,
4836   ``traversed``, ``virtual_root``, and ``virtual_root_path``.
4837
4838   Places in the BFG code which called an ITraverser continue to accept
4839   a 3-argument return value, although BFG will generate and log a
4840   warning when one is encountered.
4841
4842 - The request object now has the following attributes: ``traversed``
4843   (the sequence of names traversed or ``None`` if traversal was not
4844   performed), ``virtual_root`` (the model object representing the
4845   virtual root, including the virtual root path if any), and
4846   ``virtual_root_path`` (the seuquence of names representing the
4847   virtual root path or ``None`` if traversal was not performed).
4848
4849 - A new decorator named ``wsgiapp2`` was added to the
4850   ``repoze.bfg.wsgi`` module.  This decorator performs the same
4851   function as ``repoze.bfg.wsgi.wsgiapp`` except it fixes up the
4852   ``SCRIPT_NAME``, and ``PATH_INFO`` environment values before
4853   invoking the WSGI subapplication.
4854
4855 - The ``repoze.bfg.testing.DummyRequest`` object now has default
4856   attributes for ``traversed``, ``virtual_root``, and
4857   ``virtual_root_path``.
4858
4859 - The RoutesModelTraverser now behaves more like the Routes
4860   "RoutesMiddleware" object when an element in the match dict is named
4861   ``path_info`` (usually when there's a pattern like
4862   ``http://foo/*path_info``).  When this is the case, the
4863   ``PATH_INFO`` environment variable is set to the value in the match
4864   dict, and the ``SCRIPT_NAME`` is appended to with the prefix of the
4865   original ``PATH_INFO`` not including the value of the new variable.
4866
4867 - The notfound debug now shows the traversed path, the virtual root,
4868   and the virtual root path too.
4869
4870 - Speed up / clarify 'traversal' module's 'model_path', 'model_path_tuple',
4871   and '_model_path_list' functions.
4872
4873 Backwards Incompatibilities
4874 ---------------------------
4875
4876 - In previous releases, the ``repoze.bfg.url.model_url``,
4877   ``repoze.bfg.traversal.model_path`` and
4878   ``repoze.bfg.traversal.model_path_tuple`` functions always ignored
4879   the ``__name__`` argument of the root object in a model graph (
4880   effectively replacing it with a leading ``/`` in the returned value)
4881   when a path or URL was generated.  The code required to perform this
4882   operation was not efficient.  As of this release, the root object in
4883   a model graph *must* have a ``__name__`` attribute that is either
4884   ``None`` or the empty string (``''``) for URLs and paths to be
4885   generated properly from these APIs.  If your root model object has a
4886   ``__name__`` argument that is not one of these values, you will need
4887   to change your code for URLs and paths to be generated properly.  If
4888   your model graph has a root node with a string ``__name__`` that is
4889   not null, the value of ``__name__`` will be prepended to every path
4890   and URL generated.
4891
4892 - The ``repoze.bfg.location.LocationProxy`` class and the
4893   ``repoze.bfg.location.ClassAndInstanceDescr`` class have both been
4894   removed in order to be able to eventually shed a dependency on
4895   ``zope.proxy``.  Neither of these classes was ever an API.
4896
4897 - In all previous releases, the ``repoze.bfg.location.locate``
4898   function worked like so: if a model did not explicitly provide the
4899   ``repoze.bfg.interfaces.ILocation`` interface, ``locate`` returned a
4900   ``LocationProxy`` object representing ``model`` with its
4901   ``__parent__`` attribute assigned to ``parent`` and a ``__name__``
4902   attribute assigned to ``__name__``.  In this release, the
4903   ``repoze.bfg.location.locate`` function simply jams the ``__name__``
4904   and ``__parent__`` attributes on to the supplied model
4905   unconditionally, no matter if the object implements ILocation or
4906   not, and it never returns a proxy.  This was done because the
4907   LocationProxy behavior has now moved into an add-on package
4908   (``repoze.bfg.traversalwrapper``), in order to eventually be able to
4909   shed a dependency on ``zope.proxy``.
4910
4911 - In all previous releases, by default, if traversal was used (as
4912   opposed to URL-dispatch), and the root object supplied
4913   the``repoze.bfg.interfaces.ILocation`` interface, but the children
4914   returned via its ``__getitem__`` returned an object that did not
4915   implement the same interface, ``repoze.bfg`` provided some
4916   implicit help during traversal.  This traversal feature wrapped
4917   subobjects from the root (and thereafter) that did not implement
4918   ``ILocation`` in proxies which automatically provided them with a
4919   ``__name__`` and ``__parent__`` attribute based on the name being
4920   traversed and the previous object traversed.  This feature has now
4921   been removed from the base ``repoze.bfg`` package for purposes of
4922   eventually shedding a dependency on ``zope.proxy``.
4923
4924   In order to re-enable the wrapper behavior for older applications
4925   which cannot be changed, register the "traversalwrapper"
4926   ``ModelGraphTraverser`` as the traversal policy, rather than the
4927   default ``ModelGraphTraverser``. To use this feature, you will need
4928   to install the ``repoze.bfg.traversalwrapper`` package (an add-on
4929   package, available at
4930   http://svn.repoze.org/repoze.bfg.traversalwrapper) Then change your
4931   application's ``configure.zcml`` to include the following stanza:
4932
4933     <adapter
4934         factory="repoze.bfg.traversalwrapper.ModelGraphTraverser"
4935         provides="repoze.bfg.interfaces.ITraverserFactory"
4936         for="*"
4937         />
4938
4939    When this ITraverserFactory is used instead of the default, no
4940    object in the graph (even the root object) must supply a
4941    ``__name__`` or ``__parent__`` attribute.  Even if subobjects
4942    returned from the root *do* implement the ILocation interface,
4943    these will still be wrapped in proxies that override the object's
4944    "real" ``__parent__`` and ``__name__`` attributes.
4945
4946    See also changes to the "Models" chapter of the documentation (in
4947    the "Location-Aware Model Instances") section.
4948
4949 0.7.0 (2009-04-11)
4950 ==================
4951
4952 Bug Fixes
4953 ---------
4954
4955 - Fix a bug in ``repoze.bfg.wsgi.HTTPException``: the content length
4956   was returned as an int rather than as a string.
4957  
4958 - Add explicit dependencies on ``zope.deferredimport``,
4959   ``zope.deprecation``, and ``zope.proxy`` for forward compatibility
4960   reasons (``zope.component`` will stop relying on
4961   ``zope.deferredimport`` soon and although we use it directly, it's
4962   only a transitive dependency, and ''zope.deprecation`` and
4963   ``zope.proxy`` are used directly even though they're only transitive
4964   dependencies as well).
4965
4966 - Using ``model_url`` or ``model_path`` against a broken model graph
4967   (one with models that had a non-root model with a ``__name__`` of
4968   ``None``) caused an inscrutable error to be thrown: ( if not
4969   ``_must_quote[cachekey].search(s): TypeError: expected string or
4970   buffer``).  Now URLs and paths generated against graphs that have
4971   None names in intermediate nodes will replace the None with the
4972   empty string, and, as a result, the error won't be raised.  Of
4973   course the URL or path will still be bogus.
4974
4975 Features
4976 --------
4977
4978 - Make it possible to have ``testing.DummyTemplateRenderer`` return
4979   some nondefault string representation.
4980
4981 - Added a new ``anchor`` keyword argument to ``model_url``.  If 
4982   ``anchor`` is present, its string representation will be used 
4983   as a named anchor in the generated URL (e.g. if ``anchor`` is 
4984   passed as ``foo`` and the model URL is 
4985   ``http://example.com/model/url``, the generated URL will be 
4986   ``http://example.com/model/url#foo``).
4987
4988 Backwards Incompatibilities
4989 ---------------------------
4990
4991 - The default request charset encoding is now ``utf-8``.  As a result,
4992   the request machinery will attempt to decode values from the utf-8
4993   encoding to Unicode automatically when they are obtained via
4994   ``request.params``, ``request.GET``, and ``request.POST``.  The
4995   previous behavior of BFG was to return a bytestring when a value was
4996   accessed in this manner.  This change will break form handling code
4997   in apps that rely on values from those APIs being considered
4998   bytestrings.  If you are manually decoding values from form
4999   submissions in your application, you'll either need to change the
5000   code that does that to expect Unicode values from
5001   ``request.params``, ``request.GET`` and ``request.POST``, or you'll
5002   need to explicitly reenable the previous behavior.  To reenable the
5003   previous behavior, add the following to your application's
5004   ``configure.zcml``::
5005
5006     <subscriber for="repoze.bfg.interfaces.INewRequest"
5007                 handler="repoze.bfg.request.make_request_ascii"/>
5008
5009   See also the documentation in the "Views" chapter of the BFG docs
5010   entitled "Using Views to Handle Form Submissions (Unicode and
5011   Character Set Issues)".
5012
5013 Documentation
5014 -------------
5015
5016 - Add a section to the narrative Views chapter entitled "Using Views
5017   to Handle Form Submissions (Unicode and Character Set Issues)"
5018   explaining implicit decoding of form data values.
5019
5020 0.6.9 (2009-02-16)
5021 ==================
5022
5023 Bug Fixes
5024 ---------
5025
5026 - lru cache was unstable under concurrency (big surprise!) when it
5027   tried to redelete a key in the cache that had already been deleted.
5028   Symptom: line 64 in put:del data[oldkey]:KeyError: '/some/path'.
5029   Now we just ignore the key error if we can't delete the key (it has
5030   already been deleted).
5031
5032 - Empty location names in model paths when generating a URL using
5033   ``repoze.bfg.model_url`` based on a model obtained via traversal are
5034   no longer ignored in the generated URL.  This means that if a
5035   non-root model object has a ``__name__`` of ``''``, the URL will
5036   reflect it (e.g. ``model_url`` will generate ``http://foo/bar//baz``
5037   if an object with the ``__name__`` of ``''`` is a child of bar and
5038   the parent of baz).  URLs generated with empty path segments are,
5039   however, still irresolveable by the model graph traverser on request
5040   ingress (the traverser strips empty path segment names).
5041
5042 Features
5043 --------
5044
5045 - Microspeedups of ``repoze.bfg.traversal.model_path``,
5046   ``repoze.bfg.traversal.model_path_tuple``,
5047   ``repoze.bfg.traversal.quote_path_segment``, and
5048   ``repoze.bfg.url.urlencode``.
5049
5050 - add zip_safe = false to setup.cfg.
5051
5052 Documentation
5053 -------------
5054
5055 - Add a note to the ``repoze.bfg.traversal.quote_path_segment`` API
5056   docs about caching of computed values.
5057
5058 Implementation Changes
5059 ----------------------
5060
5061 - Simplification of
5062   ``repoze.bfg.traversal.TraversalContextURL.__call__`` (it now uses
5063   ``repoze.bfg.traversal.model_path`` instead of rolling its own
5064   path-generation).
5065
5066 0.6.8 (2009-02-05)
5067 ==================
5068
5069 Backwards Incompatibilities
5070 ---------------------------
5071
5072 - The ``repoze.bfg.traversal.model_path`` API now returns a *quoted*
5073   string rather than a string represented by series of unquoted
5074   elements joined via ``/`` characters.  Previously it returned a
5075   string or unicode object representing the model path, with each
5076   segment name in the path joined together via ``/`` characters,
5077   e.g. ``/foo /bar``.  Now it returns a string, where each segment is
5078   a UTF-8 encoded and URL-quoted element e.g. ``/foo%20/bar``.  This
5079   change was (as discussed briefly on the repoze-dev maillist)
5080   necessary to accomodate model objects which themselves have
5081   ``__name__`` attributes that contain the ``/`` character.
5082
5083   For people that have no models that have high-order Unicode
5084   ``__name__`` attributes or ``__name__`` attributes with values that
5085   require URL-quoting with in their model graphs, this won't cause any
5086   issue.  However, if you have code that currently expects
5087   ``model_path`` to return an unquoted string, or you have an existing
5088   application with data generated via the old method, and you're too
5089   lazy to change anything, you may wish replace the BFG-imported
5090   ``model_path`` in your code with this function (this is the code of
5091   the "old" ``model_path`` implementation)::
5092
5093         from repoze.bfg.location import lineage
5094
5095         def i_am_too_lazy_to_move_to_the_new_model_path(model, *elements):
5096             rpath = []
5097             for location in lineage(model):
5098                 if location.__name__:
5099                     rpath.append(location.__name__)
5100             path = '/' + '/'.join(reversed(rpath))
5101             if elements:
5102                 suffix = '/'.join(elements)
5103                 path = '/'.join([path, suffix])
5104             return path
5105
5106 - The ``repoze.bfg.traversal.find_model`` API no longer implicitly
5107   converts unicode representations of a full path passed to it as a
5108   Unicode object into a UTF-8 string.  Callers should either use
5109   prequoted path strings returned by
5110   ``repoze.bfg.traversal.model_path``, or tuple values returned by the
5111   result of ``repoze.bfg.traversal.model_path_tuple`` or they should
5112   use the guidelines about passing a string ``path`` argument
5113   described in the ``find_model`` API documentation.
5114
5115 Bugfixes
5116 --------
5117
5118 - Each argument contained in ``elements`` passed to
5119   ``repoze.bfg.traversal.model_path`` will now have any ``/``
5120   characters contained within quoted to ``%2F`` in the returned
5121   string.  Previously, ``/`` characters in elements were left unquoted
5122   (a bug).
5123
5124 Features
5125 --------
5126
5127 - A ``repoze.bfg.traversal.model_path_tuple`` API was added.  This API
5128   is an alternative to ``model_path`` (which returns a string);
5129   ``model_path_tuple`` returns a model path as a tuple (much like
5130   Zope's ``getPhysicalPath``).
5131
5132 - A ``repoze.bfg.traversal.quote_path_segment`` API was added.  This
5133   API will quote an individual path segment (string or unicode
5134   object).  See the ``repoze.bfg.traversal`` API documentation for
5135   more information.
5136
5137 - The ``repoze.bfg.traversal.find_model`` API now accepts "path
5138   tuples" (see the above note regarding ``model_path_tuple``) as well
5139   as string path representations (from
5140   ``repoze.bfg.traversal.model_path``) as a ``path`` argument.
5141
5142 - Add ` `renderer`` argument (defaulting to None) to
5143   ``repoze.bfg.testing.registerDummyRenderer``.  This makes it
5144   possible, for instance, to register a custom renderer that raises an
5145   exception in a unit test.
5146
5147 Implementation Changes
5148 ----------------------
5149
5150 - Moved _url_quote function back to ``repoze.bfg.traversal`` from
5151   ``repoze.bfg.url``.  This is not an API.
5152
5153 0.6.7 (2009-01-27)
5154 ==================
5155
5156 Features
5157 --------
5158
5159 - The ``repoze.bfg.url.model_url`` API now works against contexts
5160   derived from Routes URL dispatch (``Routes.util.url_for`` is called
5161   under the hood).
5162
5163 - "Virtual root" support for traversal-based applications has been
5164   added.  Virtual root support is useful when you'd like to host some
5165   model in a ``repoze.bfg`` model graph as an application under a
5166   URL pathname that does not include the model path itself.  For more
5167   information, see the (new) "Virtual Hosting" chapter in the
5168   documentation.
5169
5170 - A ``repoze.bfg.traversal.virtual_root`` API has been added.  When
5171   called, it returns the virtual root object (or the physical root
5172   object if no virtual root has been specified).
5173
5174 Implementation Changes
5175 ----------------------
5176
5177 - ``repoze.bfg.traversal.RoutesModelTraverser`` has been moved to
5178   ``repoze.bfg.urldispatch``.
5179
5180 - ``model_url`` URL generation is now performed via an adapter lookup
5181   based on the context and the request.
5182
5183 - ZCML which registers two adapters for the ``IContextURL`` interface
5184   has been added to the configure.zcml in ``repoze.bfg.includes``.
5185
5186 0.6.6 (2009-01-26)
5187 ==================
5188
5189 Implementation Changes
5190 ----------------------
5191
5192 - There is an indirection in ``repoze.bfg.url.model_url`` now that
5193   consults a utility to generate the base model url (without extra
5194   elements or a query string).  Eventually this will service virtual
5195   hosting; for now it's undocumented and should not be hooked.
5196
5197 0.6.5 (2009-01-26)
5198 ==================
5199
5200 Features
5201 --------
5202
5203 - You can now override the NotFound and Unauthorized responses that
5204   ``repoze.bfg`` generates when a view cannot be found or cannot be
5205   invoked due to lack of permission.  See the "ZCML Hooks" chapter in
5206   the docs for more information.
5207
5208 - Added Routes ZCML directive attribute explanations in documentation.
5209
5210 - Added a ``traversal_path`` API to the traversal module; see the
5211   "traversal" API chapter in the docs.  This was a function previously
5212   known as ``split_path`` that was not an API but people were using it
5213   anyway.  Unlike ``split_path``, it now returns a tuple instead of a
5214   list (as its values are cached).
5215
5216 Behavior Changes
5217 ----------------
5218
5219 - The ``repoze.bfg.view.render_view_to_response`` API will no longer
5220   raise a ValueError if an object returned by a view function it calls
5221   does not possess certain attributes (``headerlist``, ``app_iter``,
5222   ``status``).  This API used to attempt to perform a check using the
5223   ``is_response`` function in ``repoze.bfg.view``, and raised a
5224   ``ValueError`` if the ``is_response`` check failed.  The
5225   responsibility is now the caller's to ensure that the return value
5226   from a view function is a "real" response.
5227
5228 - WSGI environ dicts passed to ``repoze.bfg`` 's Router must now
5229   contain a REQUEST_METHOD key/value; if they do not, a KeyError will
5230   be raised (speed).  
5231
5232 - It is no longer permissible to pass a "nested" list of principals to
5233   ``repoze.bfg.ACLAuthorizer.permits`` (e.g. ``['fred', ['larry',
5234   'bob']]``).  The principals list must be fully expanded.  This
5235   feature was never documented, and was never an API, so it's not a
5236   backwards incompatibility.
5237
5238 - It is no longer permissible for a security ACE to contain a "nested"
5239   list of permissions (e.g. ``(Allow, Everyone, ['read', ['view',
5240   ['write', 'manage']]])`)`.  The list must instead be fully expanded
5241   (e.g. ``(Allow, Everyone, ['read', 'view', 'write', 'manage])``).  This
5242   feature was never documented, and was never an API, so it's not a
5243   backwards incompatibility.
5244
5245 - The ``repoze.bfg.urldispatch.RoutesRootFactory`` now injects the
5246   ``wsgiorg.routing_args`` environment variable into the environ when
5247   a route matches.  This is a tuple of ((), routing_args) where
5248   routing_args is the value that comes back from the routes mapper
5249   match (the "match dict").
5250
5251 - The ``repoze.bfg.traversal.RoutesModelTraverser`` class now wants to
5252   obtain the ``view_name`` and ``subpath`` from the
5253   ``wsgiorgs.routing_args`` environment variable.  It falls back to
5254   obtaining these from the context for backwards compatibility.
5255
5256 Implementation Changes
5257 ----------------------
5258
5259 - Get rid of ``repoze.bfg.security.ACLAuthorizer``: the
5260   ``ACLSecurityPolicy`` now does what it did inline.
5261
5262 - Get rid of ``repoze.bfg.interfaces.NoAuthorizationInformation``
5263   exception: it was used only by ``ACLAuthorizer``.
5264
5265 - Use a homegrown NotFound error instead of ``webob.exc.HTTPNotFound``
5266   (the latter is slow).
5267
5268 - Use a homegrown Unauthorized error instead of
5269   ``webob.exc.Unauthorized`` (the latter is slow).
5270
5271 - the ``repoze.bfg.lru.lru_cached`` decorator now uses functools.wraps
5272   in order to make documentation of LRU-cached functions possible.
5273
5274 - Various speed micro-tweaks.
5275
5276 Bug Fixes
5277 ---------
5278
5279 - ``repoze.bfg.testing.DummyModel`` did not have a ``get`` method;
5280   it now does.
5281
5282 0.6.4 (2009-01-23)
5283 ==================
5284
5285 Backwards Incompatibilities
5286 ---------------------------
5287
5288 - The ``unicode_path_segments`` configuration variable and the
5289   ``BFG_UNICODE_PATH_SEGMENTS`` configuration variable have been
5290   removed.  Path segments are now always passed to model
5291   ``__getitem__`` methods as unicode.  "True" has been the default for
5292   this setting since 0.5.4, but changing this configuration setting to
5293   false allowed you to go back to passing raw path element strings to
5294   model ``__getitem__`` methods.  Removal of this knob services a
5295   speed goal (we get about +80 req/s by removing the check), and it's
5296   clearer just to always expect unicode path segments in model
5297   ``__getitem__`` methods.
5298
5299 Implementation Changes
5300 ----------------------
5301
5302 - ``repoze.bfg.traversal.split_path`` now also handles decoding
5303   path segments to unicode (for speed, because its results are
5304   cached).
5305
5306 - ``repoze.bfg.traversal.step`` was made a method of the
5307    ModelGraphTraverser.
5308
5309 - Use "precooked" Request subclasses
5310   (e.g. ``repoze.bfg.request.GETRequest``) that correspond to HTTP
5311   request methods within ``router.py`` when constructing a request
5312   object rather than using ``alsoProvides`` to attach the proper
5313   interface to an unsubclassed ``webob.Request``.  This pattern is
5314   purely an optimization (e.g. preventing calls to ``alsoProvides``
5315   means the difference between 590 r/s and 690 r/s on a MacBook 2GHz).
5316
5317 - Tease out an extra 4% performance boost by changing the Router;
5318   instead of using imported ZCA APIs, use the same APIs directly
5319   against the registry that is an attribute of the Router.
5320
5321 - The registry used by BFG is now a subclass of
5322   ``zope.component.registry.Components`` (defined as
5323   ``repoze.bfg.registry.Registry``); it has a ``notify`` method, a
5324   ``registerSubscriptionAdapter`` and a ``registerHandler`` method.
5325   If no subscribers are registered via ``registerHandler`` or
5326   ``registerSubscriptionAdapter``, ``notify`` is a noop for speed.
5327
5328 - The Allowed and Denied classes in ``repoze.bfg.security`` now are
5329   lazier about constructing the representation of a reason message for
5330   speed; ``repoze.bfg.view_execution_permitted`` takes advantage of
5331   this.
5332
5333 - The ``is_response`` check was sped up by about half at the expense
5334   of making its code slightly uglier.
5335
5336 New Modules
5337 -----------
5338
5339 - ``repoze.bfg.lru`` implements an LRU cache class and a decorator for
5340   internal use.
5341
5342 0.6.3 (2009-01-19)
5343 ==================
5344
5345 Bug Fixes
5346 ---------
5347
5348 - Readd ``root_policy`` attribute on Router object (as a property
5349   which returns the IRootFactory utility).  It was inadvertently
5350   removed in 0.6.2.  Code in the wild depended upon its presence
5351   (esp. scripts and "debug" helpers).
5352
5353 Features
5354 --------
5355
5356 - URL-dispatch has been overhauled: it is no longer necessary to
5357   manually create a RoutesMapper in your application's entry point
5358   callable in order to use URL-dispatch (aka `Routes
5359   <http://routes.groovie.org>`_).  A new ``route`` directive has been
5360   added to the available list of ZCML directives.  Each ``route``
5361   directive inserted into your application's ``configure.zcml``
5362   establishes a Routes mapper connection.  If any ``route``
5363   declarations are made via ZCML within a particular application, the
5364   ``get_root`` callable passed in to ``repoze.bfg.router.make_app``
5365   will automatically be wrapped in the equivalent of a RoutesMapper.
5366   Additionally, the new ``route`` directive allows the specification
5367   of a ``context_interfaces`` attribute for a route, this will be used
5368   to tag the manufactured routes context with specific interfaces when
5369   a route specifying a ``context_interfaces`` attribute is matched.
5370
5371 - A new interface ``repoze.bfg.interfaces.IContextNotFound`` was
5372   added.  This interface is attached to a "dummy" context generated
5373   when Routes cannot find a match and there is no "fallback" get_root
5374   callable that uses traversal.
5375
5376 - The ``bfg_starter`` and ``bfg_zodb`` "paster create" templates now
5377   contain images and CSS which are displayed when the default page is
5378   displayed after initial project generation.
5379
5380 - Allow the ``repoze.bfg.view.static`` helper to be passed a relative
5381   ``root_path`` name; it will be considered relative to the file in
5382   which it was called.
5383
5384 - The functionality of ``repoze.bfg.convention`` has been merged into
5385   the core.  Applications which make use of ``repoze.bfg.convention``
5386   will continue to work indefinitely, but it is recommended that apps
5387   stop depending upon it.  To do so, substitute imports of
5388   ``repoze.bfg.convention.bfg_view`` with imports of
5389   ``repoze.bfg.view.bfg_view``, and change the stanza in ZCML from
5390   ``<convention package=".">`` to ``<scan package=".">``.  As a result
5391   of the merge, bfg has grown a new dependency: ``martian``.
5392
5393 - View functions which use the pushpage decorator are now pickleable
5394   (meaning their use won't prevent a ``configure.zcml.cache`` file
5395   from being written to disk).
5396
5397 - Instead of invariably using ``webob.Request`` as the "request
5398   factory" (e.g. in the ``Router`` class) and ``webob.Response`` and
5399   the "response factory" (e.g. in ``render_template_to_response``),
5400   allow both to be overridden via a ZCML utility hook.  See the "Using
5401   ZCML Hooks" chapter of the documentation for more information.
5402
5403 Deprecations
5404 ------------
5405
5406 - The class ``repoze.bfg.urldispatch.RoutesContext`` has been renamed
5407   to ``repoze.bfg.urldispatch.DefaultRoutesContext``.  The class
5408   should be imported by the new name as necessary (although in reality
5409   it probably shouldn't be imported from anywhere except internally
5410   within BFG, as it's not part of the API).
5411
5412 Implementation Changes
5413 ----------------------
5414
5415 - The ``repoze.bfg.wsgi.wsgiapp`` decorator now uses
5416   ``webob.Request.get_response`` to do its work rather than relying on
5417   homegrown WSGI code.
5418
5419 - The ``repoze.bfg.view.static`` helper now uses
5420   ``webob.Request.get_response`` to do its work rather than relying on
5421   homegrown WSGI code.
5422
5423 - The ``repoze.bfg.urldispatch.RoutesModelTraverser`` class has been
5424   moved to ``repoze.bfg.traversal.RoutesModelTraverser``.
5425
5426 - The ``repoze.bfg.registry.makeRegistry`` function was renamed to
5427   ``repoze.bfg.registry.populateRegistry`` and now accepts a
5428   ``registry`` argument (which should be an instance of
5429   ``zope.component.registry.Components``).
5430
5431 Documentation Additions
5432 -----------------------
5433
5434 - Updated narrative urldispatch chapter with changes required by
5435   ``<route..>`` ZCML directive.
5436
5437 - Add a section on "Using BFG Security With URL Dispatch" into the
5438   urldispatch chapter of the documentation.
5439
5440 - Better documentation of security policy implementations that ship
5441   with repoze.bfg.
5442
5443 - Added a "Using ZPT Macros in repoze.bfg" section to the narrative
5444   templating chapter.
5445
5446 0.6.2 (2009-01-13)
5447 ==================
5448
5449 Features
5450 --------
5451
5452 - Tests can be run with coverage output if you've got ``nose``
5453   installed in the interpreter which you use to run tests.  Using an
5454   interpreter with ``nose`` installed, do ``python setup.py
5455   nosetests`` within a checkout of the ``repoze.bfg`` package to see
5456   test coverage output.
5457
5458 - Added a ``post`` argument to the ``repoze.bfg.testing:DummyRequest``
5459   constructor.
5460   
5461 - Added ``__len__`` and ``__nonzero__`` to ``repoze.bfg.testing:DummyModel``.
5462
5463 - The ``repoze.bfg.registry.get_options`` callable (now renamed to
5464   ``repoze.bfg.setings.get_options``) used to return only
5465   framework-specific keys and values in the dictionary it returned.
5466   It now returns all the keys and values in the dictionary it is
5467   passed *plus* any framework-specific settings culled from the
5468   environment.  As a side effect, all PasteDeploy application-specific
5469   config file settings are made available as attributes of the
5470   ``ISettings`` utility from within BFG.
5471
5472 - Renamed the existing BFG paster template to ``bfg_starter``.  Added
5473   another template (``bfg_zodb``) showing default ZODB setup using
5474   ``repoze.zodbconn``.
5475
5476 - Add a method named ``assert_`` to the DummyTemplateRenderer.  This
5477   method accepts keyword arguments.  Each key/value pair in the
5478   keyword arguments causes an assertion to be made that the renderer
5479   received this key with a value equal to the asserted value.
5480
5481 - Projects generated by the paster templates now use the
5482   ``DummyTemplateRenderer.assert_`` method in their view tests.
5483
5484 - Make the (internal) thread local registry manager maintain a stack
5485   of registries in order to make it possible to call one BFG
5486   application from inside another.
5487
5488 - An interface specific to the HTTP verb (GET/PUT/POST/DELETE/HEAD) is
5489   attached to each request object on ingress.  The HTTP-verb-related
5490   interfaces are defined in ``repoze.bfg.interfaces`` and are
5491   ``IGETRequest``, ``IPOSTRequest``, ``IPUTRequest``,
5492   ``IDELETERequest`` and ``IHEADRequest``.  These interfaces can be
5493   specified as the ``request_type`` attribute of a bfg view
5494   declaration.  A view naming a specific HTTP-verb-matching interface
5495   will be found only if the view is defined with a request_type that
5496   matches the HTTP verb in the incoming request.  The more general
5497   ``IRequest`` interface can be used as the request_type to catch all
5498   requests (and this is indeed the default).  All requests implement
5499   ``IRequest``. The HTTP-verb-matching idea was pioneered by
5500   `repoze.bfg.restrequest
5501   <http://pypi.python.org/pypi/repoze.bfg.restrequest/1.0.1>`_ . That
5502   package is no longer required, but still functions fine.
5503
5504 Bug Fixes
5505 ---------
5506
5507 - Fix a bug where the Paste configuration's ``unicode_path_segments``
5508   (and os.environ's ``BFG_UNICODE_PATH_SEGMENTS``) may have been
5509   defaulting to false in some circumstances.  It now always defaults
5510   to true, matching the documentation and intent.
5511
5512 - The ``repoze.bfg.traversal.find_model`` API did not work properly
5513   when passed a ``path`` argument which was unicode and contained
5514   high-order bytes when the ``unicode_path_segments`` or
5515   ``BFG_UNICODE_PATH_SEGMENTS`` configuration variables were "true".
5516
5517 - A new module was added: ``repoze.bfg.settings``.  This contains
5518   deployment-settings-related code.
5519
5520 Implementation Changes
5521 ----------------------
5522
5523 - The ``make_app`` callable within ``repoze.bfg.router`` now registers
5524   the ``root_policy`` argument as a utility (unnamed, using the new
5525   ``repoze.bfg.interfaces.IRootFactory`` as a provides interface)
5526   rather than passing it as the first argument to the
5527   ``repoze.bfg.router.Router`` class.  As a result, the
5528   ``repoze.bfg.router.Router`` router class only accepts a single
5529   argument: ``registry``.  The ``repoze.bfg.router.Router`` class
5530   retrieves the root policy via a utility lookup now.  The
5531   ``repoze.bfg.router.make_app`` API also now performs some important
5532   application registrations that were previously handled inside
5533   ``repoze.bfg.registry.makeRegistry``.
5534
5535 New Modules
5536 -----------
5537
5538 - A ``repoze.bfg.settings`` module was added.  It contains code
5539   related to deployment settings.  Most of the code it contains was
5540   moved to it from the ``repoze.bfg.registry`` module.
5541
5542 Behavior Changes
5543 ----------------
5544
5545 - The ``repoze.bfg.settings.Settings`` class (an instance of which is
5546   registered as a utility providing
5547   ``repoze.bfg.interfaces.ISettings`` when any application is started)
5548   now automatically calls ``repoze.bfg.settings.get_options`` on the
5549   options passed to its constructor.  This means that usage of
5550   ``get_options`` within an application's ``make_app`` function is no
5551   longer required (the "raw" ``options`` dict or None may be passed).
5552
5553 - Remove old cold which attempts to recover from trying to unpickle a
5554   ``z3c.pt`` template; Chameleon has been the templating engine for a
5555   good long time now.  Running repoze.bfg against a sandbox that has
5556   pickled ``z3c.pt`` templates it will now just fail with an
5557   unpickling error, but can be fixed by deleting the template cache
5558   files.
5559
5560 Deprecations
5561 ------------
5562
5563 - Moved the ``repoze.bfg.registry.Settings`` class.  This has been
5564   moved to ``repoze.bfg.settings.Settings``. A deprecation warning is
5565   issued when it is imported from the older location.
5566
5567 - Moved the ``repoze.bfg.registry.get_options`` function This has been
5568   moved to ``repoze.bfg.settings.get_options``.  A deprecation warning
5569   is issued when it is imported from the older location.
5570
5571 - The ``repoze.bfg.interfaces.IRootPolicy`` interface was renamed
5572   within the interfaces package.  It has been renamed to
5573   ``IRootFactory``.  A deprecation warning is issued when it is
5574   imported from the older location.
5575
5576 0.6.1 (2009-01-06)
5577 ==================
5578
5579 New Modules
5580 -----------
5581
5582 - A new module ``repoze.bfg.url`` has been added.  It contains the
5583   ``model_url`` API (moved from ``repoze.bfg.traversal``) and an
5584   implementation of ``urlencode`` (like Python's
5585   ``urllib.urlencode``) which can handle Unicode keys and values in
5586   parameters to the ``query`` argument.
5587
5588 Deprecations
5589 ------------
5590
5591 - The ``model_url`` function has been moved from
5592   ``repoze.bfg.traversal`` into ``repoze.bfg.url``.  It can still
5593   be imported from ``repoze.bfg.traversal`` but an import from
5594   ``repoze.bfg.traversal`` will emit a DeprecationWarning.
5595
5596 Features
5597 --------
5598
5599 - A ``static`` helper class was added to the ``repoze.bfg.views``
5600   module.  Instances of this class are willing to act as BFG views
5601   which return static resources using files on disk.  See the
5602   ``repoze.bfg.view`` docs for more info.
5603
5604 - The ``repoze.bfg.url.model_url`` API (nee'
5605   ``repoze.bfg.traversal.model_url``) now accepts and honors a
5606   keyword argument named ``query``.  The value of this argument
5607   will be used to compose a query string, which will be attached to
5608   the generated URL before it is returned.  See the API docs (in
5609   the docs directory or `on the web
5610   <http://static.repoze.org/bfgdocs>`_) for more information.
5611
5612 0.6 (2008-12-26)
5613 ================
5614
5615 Backwards Incompatibilities
5616 ---------------------------
5617
5618 - Rather than prepare the "stock" implementations of the ZCML directives
5619   from the ``zope.configuration`` package for use under ``repoze.bfg``,
5620   ``repoze.bfg`` now makes available the implementations of directives
5621   from the ``repoze.zcml`` package (see http://static.repoze.org/zcmldocs).
5622   As a result, the ``repoze.bfg`` package now depends on the
5623   ``repoze.zcml`` package, and no longer depends directly on the
5624   ``zope.component``, ``zope.configuration``, ``zope.interface``, or
5625   ``zope.proxy`` packages.
5626
5627   The primary reason for this change is to enable us to eventually reduce
5628   the number of inappropriate ``repoze.bfg`` Zope package dependencies,
5629   as well as to shed features of dependent package directives that don't
5630   make sense for ``repoze.bfg``.
5631
5632   Note that currently the set of requirements necessary to use bfg has not
5633   changed.  This is due to inappropriate Zope package requirements in
5634   ``chameleon.zpt``, which will hopefully be remedied soon. NOTE: in
5635   lemonade index a 1.0b8-repozezcml0 package exists which does away with
5636   these requirements.
5637
5638 - BFG applications written prior to this release which expect the "stock"
5639   ``zope.component`` ZCML directive implementations (e.g. ``adapter``,
5640   ``subscriber``, or ``utility``) to function now must either 1) include
5641   the ``meta.zcml`` file from ``zope.component`` manually (e.g. ``<include
5642   package="zope.component" file="meta.zcml">``) and include the
5643   ``zope.security`` package as an ``install_requires`` dependency or 2)
5644   change the ZCML in their applications to use the declarations from
5645   `repoze.zcml <http://static.repoze.org/zcmldocs/>`_ instead of the stock
5646   declarations.  ``repoze.zcml`` only makes available the ``adapter``,
5647   ``subscriber`` and ``utility`` directives.
5648
5649   In short, if you've got an existing BFG application, after this
5650   update, if your application won't start due to an import error for
5651   "zope.security", the fastest way to get it working again is to add
5652   ``zope.security`` to the "install_requires" of your BFG
5653   application's ``setup.py``, then add the following ZCML anywhere
5654   in your application's ``configure.zcml``::
5655
5656    <include package="zope.component" file="meta.zcml">
5657
5658   Then re-``setup.py develop`` or reinstall your application.
5659
5660 - The ``http://namespaces.repoze.org/bfg`` XML namespace is now the default
5661   XML namespace in ZCML for paster-generated applications.  The docs have
5662   been updated to reflect this.
5663
5664 - The copies of BFG's ``meta.zcml`` and ``configure.zcml`` were removed
5665   from the root of the ``repoze.bfg`` package.  In 0.3.6, a new package
5666   named ``repoze.bfg.includes`` was added, which contains the "correct"
5667   copies of these ZCML files; the ones that were removed were for backwards
5668   compatibility purposes.
5669
5670 - The BFG ``view`` ZCML directive no longer calls
5671   ``zope.component.interface.provideInterface`` for the ``for`` interface.
5672   We don't support ``provideInterface`` in BFG because it mutates the
5673   global registry.
5674
5675 Other
5676 -----
5677
5678 - The minimum requirement for ``chameleon.core`` is now 1.0b13.  The
5679   minimum requirement for ``chameleon.zpt`` is now 1.0b8.  The minimum
5680   requirement for ``chameleon.genshi`` is now 1.0b2.
5681
5682 - Updated paster template "ez_setup.py" to one that requires setuptools
5683   0.6c9.
5684
5685 - Turn ``view_execution_permitted`` from the ``repoze.bfg.view`` module
5686   into a documented API.
5687
5688 - Doc cleanups.
5689
5690 - Documented how to create a view capable of serving static resources.
5691
5692 0.5.6 (2008-12-18)
5693 ==================
5694
5695 - Speed up ``traversal.model_url`` execution by using a custom url quoting
5696   function instead of Python's ``urllib.quote``, by caching URL path
5697   segment quoting and encoding results, by disusing Python's
5698   ``urlparse.urljoin`` in favor of a simple string concatenation, and by
5699   using ``ob.__class__ is unicode`` rather than ``isinstance(ob, unicode)``
5700   in one strategic place.
5701
5702 0.5.5 (2008-12-17)
5703 ==================
5704
5705 Backwards Incompatibilities
5706 ---------------------------
5707
5708 - In the past, during traversal, the ModelGraphTraverser (the default
5709   traverser) always passed each URL path segment to any ``__getitem__``
5710   method of a model object as a byte string (a ``str`` object).  Now, by
5711   default the ModelGraphTraverser attempts to decode the path segment to
5712   Unicode (a ``unicode`` object) using the UTF-8 encoding before passing it
5713   to the ``__getitem__`` method of a model object.  This makes it possible
5714   for model objects to be dumber in ``__getitem__`` when trying to resolve
5715   a subobject, as model objects themselves no longer need to try to divine
5716   whether or not to try to decode the path segment passed by the
5717   traverser.
5718
5719   Note that since 0.5.4, URLs generated by repoze.bfg's ``model_url`` API
5720   will contain UTF-8 encoded path segments as necessary, so any URL
5721   generated by BFG itself will be decodeable by the traverser.  If another
5722   application generates URLs to a BFG application, to be resolved
5723   successully, it should generate the URL with UTF-8 encoded path segments
5724   to be successfully resolved.  The decoder is not at all magical: if a
5725   non-UTF-8-decodeable path segment (e.g. one encoded using UTF-16 or some
5726   other insanity) is passed in the URL, BFG will raise a ``TypeError`` with
5727   a message indicating it could not decode the path segment.
5728
5729   To turn on the older behavior, where path segments were not decoded to
5730   Unicode before being passed to model object ``__getitem__`` by the
5731   traverser, and were passed as a raw byte string, set the
5732   ``unicode_path_segments`` configuration setting to a false value in your
5733   BFG application's section of the paste .ini file, for example::
5734
5735     unicode_path_segments = False
5736
5737   Or start the application using the ``BFG_UNICODE_PATH_SEGMENT`` envvar
5738   set to a false value::
5739
5740     BFG_UNICODE_PATH_SEGMENTS=0
5741
5742 0.5.4 (2008-12-13)
5743 ==================
5744
5745 Backwards Incompatibilities
5746 ---------------------------
5747
5748 - URL-quote "extra" element names passed in as ``**elements`` to the
5749   ``traversal.model_url`` API.  If any of these names is a Unicode string,
5750   encode it to UTF-8 before URL-quoting.  This is a slight backwards
5751   incompatibility that will impact you if you were already UTF-8 encoding
5752   or URL-quoting the values you passed in as ``elements`` to this API.
5753
5754 Bugfixes
5755 --------
5756
5757 - UTF-8 encode each segment in the model path used to generate a URL before
5758   url-quoting it within the ``traversal.model_url`` API.  This is a bugfix,
5759   as Unicode cannot always be successfully URL-quoted.
5760
5761 Features
5762 --------
5763
5764 - Make it possible to run unit tests using a buildout-generated Python
5765   "interpreter".  
5766
5767 - Add ``request.root`` to ``router.Router`` in order to have easy access to
5768   the application root.
5769
5770 0.5.3 (2008-12-07)
5771 ==================
5772
5773 - Remove the ``ITestingTemplateRenderer`` interface.  When
5774   ``testing.registerDummyRenderer`` is used, it instead registers a dummy
5775   implementation using ``ITemplateRenderer`` interface, which is checked
5776   for when the built-in templating facilities do rendering.  This change
5777   also allows developers to make explcit named utility registrations in
5778   the ZCML registry against ``ITemplateRenderer``; these will be found
5779   before any on-disk template is looked up.
5780
5781 0.5.2 (2008-12-05)
5782 ==================
5783
5784 - The component registration handler for views (functions or class
5785   instances) now observes component adaptation annotations (see
5786   ``zope.component.adaptedBy``) and uses them before the fallback values
5787   for ``for_`` and ``request_type``. This change does not affect existing
5788   code insomuch as the code does not rely on these defaults when an
5789   annotation is set on the view (unlikely).  This means that for a
5790   new-style class you can do ``zope.component.adapts(ISomeContext,
5791   ISomeRequest)`` at class scope or at module scope as a decorator to a
5792   bfg view function you can do ``@zope.component.adapter(ISomeContext,
5793   ISomeRequest)``.  This differs from r.bfg.convention inasmuch as you
5794   still need to put something in ZCML for the registrations to get done;
5795   it's only the defaults that will change if these declarations exist.
5796
5797 - Strip all slashes from end and beginning of path in clean_path within
5798   traversal machinery.
5799
5800 0.5.1 (2008-11-25)
5801 ==================
5802
5803 - Add ``keys``, ``items``, and ``values`` methods to
5804   ``testing.DummyModel``.
5805
5806 - Add __delitem__ method to ``testing.DummyModel``.
5807
5808 0.5.0 (2008-11-18)
5809 ==================
5810
5811 - Fix ModelGraphTraverser; don't try to change the ``__name__`` or
5812   ``__parent__`` of an object that claims it implements ILocation during
5813   traversal even if the ``__name__`` or ``__parent__`` of the object
5814   traversed does not match the name used in the traversal step or the or
5815   the traversal parent .  Rationale: it was insane to do so. This bug was
5816   only found due to a misconfiguration in an application that mistakenly
5817   had intermediate persistent non-ILocation objects; traversal was causing
5818   a persistent write on every request under this setup.
5819
5820 - ``repoze.bfg.location.locate`` now unconditionally sets ``__name__`` and
5821   ``__parent__`` on objects which provide ILocation (it previously only set
5822   them conditionally if they didn't match attributes already present on the
5823   object via equality).
5824
5825 0.4.9 (2008-11-17)
5826 ==================
5827
5828 - Add chameleon text template API (chameleon ${name} renderings where the
5829   template does not need to be wrapped in any containing XML).
5830
5831 - Change docs to explain install in terms of a virtualenv
5832   (unconditionally).
5833
5834 - Make pushpage decorator compatible with repoze.bfg.convention's
5835   ``bfg_view`` decorator when they're stacked.
5836
5837 - Add content_length attribute to testing.DummyRequest.
5838
5839 - Change paster template ``tests.py`` to include a true unit test.  Retain
5840   old test as an integration test.  Update documentation.
5841
5842 - Document view registrations against classes and ``repoze.bfg.convention``
5843   in context.
5844
5845 - Change the default paster template to register its single view against a
5846   class rather than an interface.
5847
5848 - Document adding a request type interface to the request via a subscriber
5849   function in the events narrative documentation.
5850
5851 0.4.8 (2008-11-12)
5852 ==================
5853
5854 Backwards Incompatibilities
5855 ---------------------------
5856
5857 - ``repoze.bfg.traversal.model_url`` now always appends a slash to all
5858   generated URLs unless further elements are passed in as the third and
5859   following arguments.  Rationale: views often use ``model_url`` without
5860   the third-and-following arguments in order to generate a URL for a model
5861   in order to point at the default view of a model.  The URL that points to
5862   the default view of the *root* model is technically ``http://mysite/`` as
5863   opposed to ``http://mysite`` (browsers happen to ask for '/' implicitly
5864   in the GET request).  Because URLs are never automatically generated for
5865   anything *except* models by ``model_url``, and because the root model is
5866   not really special, we continue this pattern.  The impact of this change
5867   is minimal (at most you will have too many slashes in your URL, which BFG
5868   deals with gracefully anyway).
5869
5870 0.4.7 (2008-11-11)
5871 ==================
5872
5873 Features
5874 --------
5875
5876 - Allow ``testing.registerEventListener`` to be used with Zope 3 style
5877   "object events" (subscribers accept more than a single event argument).
5878   We extend the list with the arguments, rather than append.
5879
5880 0.4.6 (2008-11-10)
5881 ==================
5882
5883 Bug Fixes
5884 ---------
5885
5886 - The ``model_path`` and ``model_url`` traversal APIs returned the wrong
5887   value for the root object (e.g. ``model_path`` returned ``''`` for the
5888   root object, while it should have been returning ``'/'``).
5889
5890 0.4.5 (2008-11-09)
5891 ==================
5892
5893 Features
5894 --------
5895
5896 - Added a ``clone`` method and a ``__contains__`` method to the DummyModel
5897   testing object.
5898
5899 - Allow DummyModel objects to receive extra keyword arguments, which will
5900   be attached as attributes.
5901
5902 - The DummyTemplateRenderer now returns ``self`` as its implementation.
5903
5904 0.4.4 (2008-11-08)
5905 ==================
5906
5907 Features
5908 --------
5909
5910 - Added a ``repoze.bfg.testing`` module to attempt to make it slightly
5911   easier to write unittest-based automated tests of BFG applications.
5912   Information about this module is in the documentation.
5913
5914 - The default template renderer now supports testing better by looking for
5915   ``ITestingTemplateRenderer`` using a relative pathname.  This is exposed
5916   indirectly through the API named ``registerTemplateRenderer`` in
5917   ``repoze.bfg.testing``.
5918
5919 Deprecations
5920 ------------
5921
5922 - The names ``repoze.bfg.interfaces.ITemplate`` ,
5923   ``repoze.bfg.interfaces.ITemplateFactory`` and
5924   ``repoze.bfg.interfaces.INodeTemplate`` have been deprecated.  These
5925   should now be imported as ``repoze.bfg.interfaces.ITemplateRenderer`` and
5926   ``repoze.bfg.interfaces.ITemplateRendererFactory``, and
5927   ``INodeTemplateRenderer`` respectively.
5928
5929 - The name ``repoze.bfg.chameleon_zpt.ZPTTemplateFactory`` is deprecated.
5930   Use ``repoze.bfg.chameleon_zpt.ZPTTemplateRenderer``.
5931
5932 - The name ``repoze.bfg.chameleon_genshi.GenshiTemplateFactory`` is
5933   deprecated.  Use ``repoze.bfg.chameleon_genshi.GenshiTemplateRenderer``.
5934
5935 - The name ``repoze.bfg.xslt.XSLTemplateFactory`` is deprecated.  Use
5936   ``repoze.bfg.xslt.XSLTemplateRenderer``.
5937
5938 0.4.3 (2008-11-02)
5939 ==================
5940
5941 Bug Fixes
5942 ---------
5943
5944 - Not passing the result of "get_options" as the second argument of
5945   make_app could cause attribute errors when attempting to look up settings
5946   against the ISettings object (internal).  Fixed by giving the Settings
5947   objects defaults for ``debug_authorization`` and ``debug_notfound``.
5948
5949 - Return an instance of ``Allowed`` (rather than ``True``) from
5950   ``has_permission`` when no security policy is in use.
5951
5952 - Fix bug where default deny in authorization check would throw a TypeError
5953   (use ``ACLDenied`` instead of ``Denied``).
5954
5955 0.4.2 (2008-11-02)
5956 ==================
5957
5958 Features
5959 --------
5960
5961 - Expose a single ILogger named "repoze.bfg.debug" as a utility; this
5962   logger is registered unconditionally and is used by the authorization
5963   debug machinery.  Applications may also make use of it as necessary
5964   rather than inventing their own logger, for convenience.
5965
5966 - The ``BFG_DEBUG_AUTHORIZATION`` envvar and the ``debug_authorization``
5967   config file value now only imply debugging of view-invoked security
5968   checks.  Previously, information was printed for every call to
5969   ``has_permission`` as well, which made output confusing.  To debug
5970   ``has_permission`` checks and other manual permission checks, use the
5971   debugger and print statements in your own code.
5972
5973 - Authorization debugging info is now only present in the HTTP response
5974   body oif ``debug_authorization`` is true.
5975
5976 - The format of authorization debug messages was improved.
5977
5978 - A new ``BFG_DEBUG_NOTFOUND`` envvar was added and a symmetric
5979   ``debug_notfound`` config file value was added.  When either is true, and
5980   a NotFound response is returned by the BFG router (because a view could
5981   not be found), debugging information is printed to stderr.  When this
5982   value is set true, the body of HTTPNotFound responses will also contain
5983   the same debugging information.
5984
5985 - ``Allowed`` and ``Denied`` responses from the security machinery are now
5986   specialized into two types: ACL types, and non-ACL types.  The
5987   ACL-related responses are instances of ``repoze.bfg.security.ACLAllowed``
5988   and ``repoze.bfg.security.ACLDenied``.  The non-ACL-related responses are
5989   ``repoze.bfg.security.Allowed`` and ``repoze.bfg.security.Denied``.  The
5990   allowed-type responses continue to evaluate equal to things that
5991   themselves evaluate equal to the ``True`` boolean, while the denied-type
5992   responses continue to evaluate equal to things that themselves evaluate
5993   equal to the ``False`` boolean.  The only difference between the two
5994   types is the information attached to them for debugging purposes.
5995
5996 - Added a new ``BFG_DEBUG_ALL`` envvar and a symmetric ``debug_all`` config
5997   file value.  When either is true, all other debug-related flags are set
5998   true unconditionally (e.g. ``debug_notfound`` and
5999   ``debug_authorization``).
6000
6001 Documentation
6002 -------------
6003
6004 - Added info about debug flag changes.
6005
6006 - Added a section to the security chapter named "Debugging Imperative
6007   Authorization Failures" (for e.g. ``has_permssion``).
6008
6009 Bug Fixes
6010 ---------
6011
6012 - Change default paster template generator to use ``Paste#http`` server
6013   rather than ``PasteScript#cherrpy`` server.  The cherrypy server has a
6014   security risk in it when ``REMOTE_USER`` is trusted by the downstream
6015   application.
6016
6017 0.4.1 (2008-10-28)
6018 ==================
6019
6020 Bug Fixes
6021 ---------
6022
6023 - If the ``render_view_to_response`` function was called, if the view was
6024   found and called, but it returned something that did not implement
6025   IResponse, the error would pass by unflagged.  This was noticed when I
6026   created a view function that essentially returned None, but received a
6027   NotFound error rather than a ValueError when the view was rendered.  This
6028   was fixed.
6029
6030 0.4.0 (2008-10-03)
6031 ==================
6032
6033 Docs 
6034 ----
6035
6036 - An "Environment and Configuration" chapter was added to the narrative 
6037   portion of the documentation.
6038
6039 Features
6040 --------
6041
6042 - Ensure bfg doesn't generate warnings when running under Python
6043   2.6.
6044
6045 - The environment variable ``BFG_RELOAD_TEMPLATES`` is now available
6046   (serves the same purpose as ``reload_templates`` in the config file).
6047
6048 - A new configuration file option ``debug_authorization`` was added.
6049   This turns on printing of security authorization debug statements
6050   to ``sys.stderr``.  The ``BFG_DEBUG_AUTHORIZATION`` environment
6051   variable was also added; this performs the same duty.
6052
6053 Bug Fixes
6054 ---------
6055
6056 - The environment variable ``BFG_SECURITY_DEBUG`` did not always work.
6057   It has been renamed to ``BFG_DEBUG_AUTHORIZATION`` and fixed.
6058
6059 Deprecations
6060 ------------
6061
6062 - A deprecation warning is now issued when old API names from the
6063   ``repoze.bfg.templates`` module are imported.
6064
6065 Backwards incompatibilities
6066 ---------------------------
6067
6068 - The ``BFG_SECURITY_DEBUG`` environment variable was renamed to
6069   ``BFG_DEBUG_AUTHORIZATION``.
6070
6071 0.3.9 (2008-08-27)
6072 ==================
6073
6074 Features
6075 --------
6076
6077 - A ``repoze.bfg.location`` API module was added.
6078
6079 Backwards incompatibilities
6080 ---------------------------
6081
6082 - Applications must now use the ``repoze.bfg.interfaces.ILocation``
6083   interface rather than ``zope.location.interfaces.ILocation`` to
6084   represent that a model object is "location-aware".  We've removed
6085   a dependency on ``zope.location`` for cleanliness purposes: as
6086   new versions of zope libraries are released which have improved
6087   dependency information, getting rid of our dependence on
6088   ``zope.location`` will prevent a newly installed repoze.bfg
6089   application from requiring the ``zope.security``, egg, which not
6090   truly used at all in a "stock" repoze.bfg setup.  These
6091   dependencies are still required by the stack at this time; this
6092   is purely a futureproofing move.
6093
6094   The security and model documentation for previous versions of
6095   ``repoze.bfg`` recommended using the
6096   ``zope.location.interfaces.ILocation`` interface to represent
6097   that a model object is "location-aware".  This documentation has
6098   been changed to reflect that this interface should now be
6099   imported from ``repoze.bfg.interfaces.ILocation`` instead.
6100
6101 0.3.8 (2008-08-26)
6102 ==================
6103
6104 Docs
6105 ----
6106
6107 - Documented URL dispatch better in narrative form.
6108
6109 Bug fixes
6110 ---------
6111
6112 - Routes URL dispatch did not have access to the WSGI environment,
6113   so conditions such as method=GET did not work.
6114
6115 Features
6116 --------
6117
6118 - Add ``principals_allowed_by_permission`` API to security module.
6119
6120 - Replace ``z3c.pt`` support with support for ``chameleon.zpt``.
6121   Chameleon is the new name for the package that used to be named
6122   ``z3c.pt``.  NOTE: If you update a ``repoze.bfg`` SVN checkout
6123   that you're using for development, you will need to run "setup.py
6124   install" or "setup.py develop" again in order to obtain the
6125   proper Chameleon packages.  ``z3c.pt`` is no longer supported by
6126   ``repoze.bfg``.  All API functions that used to render ``z3c.pt``
6127   templates will work fine with the new packages, and your
6128   templates should render almost identically.
6129
6130 - Add a ``repoze.bfg.chameleon_zpt`` module.  This module provides
6131   Chameleon ZPT support.
6132
6133 - Add a ``repoze.bfg.xslt`` module.  This module provides XSLT
6134   support.
6135
6136 - Add a ``repoze.bfg.chameleon_genshi`` module.  This provides
6137   direct Genshi support, which did not exist previously.
6138
6139 Deprecations
6140 ------------
6141
6142 - Importing API functions directly from ``repoze.bfg.template`` is
6143   now deprecated.  The ``get_template``, ``render_template``,
6144   ``render_template_to_response`` functions should now be imported
6145   from ``repoze.chameleon_zpt``.  The ``render_transform``, and
6146   ``render_transform_to_response`` functions should now be imported
6147   from ``repoze.bfg.xslt``.  The ``repoze.bfg.template`` module
6148   will remain around "forever" to support backwards compatibility.
6149
6150 0.3.7 (2008-09-09)
6151 ==================
6152
6153 Features
6154 --------
6155
6156 - Add compatibility with z3c.pt 1.0a7+ (z3c.pt became a namespace package).
6157
6158 Bug fixes
6159 ---------
6160
6161 - ``repoze.bfg.traversal.find_model`` function did not function properly.
6162
6163 0.3.6 (2008-09-04)
6164 ==================
6165
6166 Features
6167 --------
6168
6169 - Add startup process docs.
6170
6171 - Allow configuration cache to be bypassed by actions which include special
6172   "uncacheable" discriminators (for actions that have variable results).
6173
6174 Bug Fixes
6175 ---------
6176
6177 - Move core repoze.bfg ZCML into a ``repoze.bfg.includes`` package so we
6178   can use repoze.bfg better as a namespace package.  Adjust the code
6179   generator to use it.  We've left around the ``configure.zcml`` in the
6180   repoze.bfg package directly so as not to break older apps.
6181
6182 - When a zcml application registry cache was unpickled, and it contained a
6183   reference to an object that no longer existed (such as a view), bfg would
6184   not start properly.
6185
6186 0.3.5 (2008-09-01)
6187 ==================
6188
6189 Features
6190 --------
6191
6192 - Event notification is issued after application is created and configured
6193   (``IWSGIApplicationCreatedEvent``).
6194
6195 - New API module: ``repoze.bfg.view``.  This module contains the functions
6196   named ``render_view_to_response``, ``render_view_to_iterable``,
6197   ``render_view`` and ``is_response``, which are documented in the API
6198   docs.  These features aid programmatic (non-server-driven) view
6199   execution.
6200
6201 0.3.4 (2008-08-28)
6202 ==================
6203
6204 Backwards incompatibilities
6205 ---------------------------
6206
6207 - Make ``repoze.bfg`` a namespace package so we can allow folks to create
6208   subpackages (e.g. ``repoze.bfg.otherthing``) within separate eggs.  This
6209   is a backwards incompatible change which makes it impossible to import
6210   "make_app" and "get_options" from the ``repoze.bfg`` module directly.
6211   This change will break all existing apps generated by the paster code
6212   generator.  Instead, you need to import these functions as
6213   ``repoze.bfg.router:make_app`` and ``repoze.bfg.registry:get_options``,
6214   respectively.  Sorry folks, it has to be done now or never, and
6215   definitely better now.
6216
6217 Features
6218 --------
6219
6220 - Add ``model_path`` API function to traversal module.
6221
6222 Bugfixes
6223
6224 - Normalize path returned by repoze.bfg.caller_path.
6225
6226 0.3.3 (2008-08-23)
6227 ==================
6228
6229 - Fix generated test.py module to use project name rather than package
6230   name.
6231
6232 0.3.2 (2008-08-23)
6233 ==================
6234
6235 - Remove ``sampleapp`` sample application from bfg package itself.
6236
6237 - Remove dependency on FormEncode (only needed by sampleapp).
6238
6239 - Fix paster template generation so that case-sensitivity is preserved for
6240   project vs. package name.
6241
6242 - Depend on ``z3c.pt`` version 1.0a1 (which requires the ``[lxml]`` extra
6243   currently).
6244
6245 - Read and write a pickled ZCML actions list, stored as
6246   ``configure.zcml.cache`` next to the applications's "normal"
6247   configuration file.  A given bfg app will usually start faster if it's
6248   able to read the pickle data.  It fails gracefully to reading the real
6249   ZCML file if it cannot read the pickle.
6250
6251 0.3.1 (2008-08-20)
6252 ==================
6253
6254 - Generated application differences: ``make_app`` entry point renamed to
6255   ``app`` in order to have a different name than the bfg function of the
6256   same name, to prevent confusion.
6257
6258 - Add "options" processing to bfg's ``make_app`` to support runtime
6259   options.  A new API function named ``get_options`` was added to the
6260   registry module.  This function is typically used in an application's
6261   ``app`` entry point.  The Paste config file section for the app can now
6262   supply the ``reload_templates`` option, which, if true, will prevent the
6263   need to restart the appserver in order for ``z3c.pt`` or XSLT template
6264   changes to be detected.
6265
6266 - Use only the module name in generated project's "test_suite" (run all
6267   tests found in the package).
6268
6269 - Default port for generated apps changed from 5432 to 6543 (Postgres
6270   default port is 6543).
6271
6272 0.3.0 (2008-08-16)
6273 ==================
6274
6275 - Add ``get_template`` API to template module.
6276
6277 0.2.9 (2008-08-11)
6278 ==================
6279
6280 - 0.2.8 was "brown bag" release.  It didn't work at all.  Symptom:
6281   ComponentLookupError when trying to render a page.
6282
6283 0.2.8 (2008-08-11)
6284 ==================
6285
6286 - Add ``find_model`` and ``find_root`` traversal APIs.  In the process,
6287   make ITraverser a uni-adapter (on context) rather than a multiadapter (on
6288   context and request).
6289
6290 0.2.7 (2008-08-05)
6291 ==================
6292
6293 - Add a ``request_type`` attribute to the available attributes of a
6294   ``bfg:view`` configure.zcml element.  This attribute will have a value
6295   which is a dotted Python path, pointing at an interface.  If the request
6296   object implements this interface when the view lookup is performed, the
6297   appropriate view will be called.  This is meant to allow for simple
6298   "skinning" of sites based on request type.  An event subscriber should
6299   attach the interface to the request on ingress to support skins.
6300
6301 - Remove "template only" views.  These were just confusing and were never
6302   documented.
6303
6304 - Small url dispatch overhaul: the ``connect`` method of the
6305   ``urldispatch.RoutesMapper`` object now accepts a keyword parameter named
6306   ``context_factory``.  If this parameter is supplied, it must be a
6307   callable which returns an instance.  This instance is used as the context
6308   for the request when a route is matched.
6309
6310 - The registration of a RoutesModelTraverser no longer needs to be
6311   performed by the application; it's in the bfg ZCML now.
6312
6313 0.2.6 (2008-07-31)
6314 ==================
6315
6316 - Add event sends for INewRequest and INewResponse.  See the events.rst
6317   chapter in the documentation's ``api`` directory.
6318
6319 0.2.5 (2008-07-28)
6320 ==================
6321
6322 - Add ``model_url`` API.
6323
6324 0.2.4 (2008-07-27)
6325 ==================
6326
6327 - Added url-based dispatch.
6328
6329 0.2.3 (2008-07-20)
6330 ==================
6331
6332 - Add API functions for authenticated_userid and effective_principals.
6333
6334 0.2.2 (2008-07-20)
6335 ==================
6336
6337 - Add authenticated_userid and effective_principals API to security
6338   policy.
6339
6340 0.2.1 (2008-07-20)
6341 ==================
6342
6343 - Add find_interface API.
6344
6345 0.2 (2008-07-19)
6346 ================
6347
6348 - Add wsgiapp decorator.
6349
6350 - The concept of "view factories" was removed in favor of always calling a
6351   view, which is a callable that returns a response directly (as opposed to
6352   returning a view).  As a result, the ``factory`` attribute in the
6353   bfg:view ZCML statement has been renamed to ``view``.  Various interface
6354   names were changed also.
6355
6356 - ``render_template`` and ``render_transform`` no longer return a Response
6357   object.  Instead, these return strings.  The old behavior can be obtained
6358   by using ``render_template_to_response`` and
6359   ``render_transform_to_response``.
6360
6361 - Added 'repoze.bfg.push:pushpage' decorator, which creates BFG views from
6362   callables which take (context, request) and return a mapping of top-level
6363   names.
6364
6365 - Added ACL-based security.
6366
6367 - Support for XSLT templates via a render_transform method
6368
6369 0.1 (2008-07-08)
6370 ================
6371
6372 - Initial release.
6373