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 |
|
|
390 |
- The route pattern registered internally for a a local "static view" |
|
391 |
(either via the ``static`` ZCML directive or via the |
|
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 |
|
691 |
patterns with an arbitrary traversal path without using a a |
|
692 |
``*traverse`` remainder marker; instead you can use other match |
|
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 |
|
1384 |
want to order the requires interfaces so that the the elements which |
|
1385 |
are more likely to be registered using specific interfaces are |
|
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 |
|
|
1863 |
- The the long description of this package (as shown on PyPI) was not |
|
1864 |
valid reStructuredText, and so was not renderable. |
|
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 |
|
2923 |
``Unauthorized`` to ``Forbidden`` brings parity to the the name of |
|
2924 |
the exception and the system view it invokes when raised. |
|
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 |
|
4612 |
``Routes-1.11dev-chrism-home``. The source for the fork exists at |
|
4613 |
`http://bitbucket.org/chrism/routes-home/ |
|
4614 |
<http://bitbucket.org/chrism/routes-home/>`_; its contents have been |
|
4615 |
merged into the Routes trunk (what will be Routes 1.11). |
|
4616 |
|
|
4617 |
0.8a5 (2009-05-08) |
|
4618 |
================== |
|
4619 |
|
|
4620 |
Features |
|
4621 |
-------- |
|
4622 |
|
|
4623 |
- Two new security policies were added: |
|
4624 |
RemoteUserInheritingACLSecurityPolicy and |
|
4625 |
WhoInheritingACLSecurityPolicy. These are security policies which |
|
4626 |
take into account *all* ACLs defined in the lineage of a context |
|
4627 |
rather than stopping at the first ACL found in a lineage. See the |
|
4628 |
"Security" chapter of the API documentation for more information. |
|
4629 |
|
|
4630 |
- The API and narrative documentation dealing with security was |
|
4631 |
changed to introduce the new "inheriting" security policy variants. |
|
4632 |
|
|
4633 |
- Added glossary entry for "lineage". |
|
4634 |
|
|
4635 |
Deprecations |
|
4636 |
------------ |
|
4637 |
|
|
4638 |
- The security policy previously named |
|
4639 |
``RepozeWhoIdentityACLSecurityPolicy`` now has the slightly saner |
|
4640 |
name of ``WhoACLSecurityPolicy``. A deprecation warning is emitted |
|
4641 |
when this policy is imported under the "old" name; usually this is |
|
4642 |
due to its use in ZCML within your application. If you're getting |
|
4643 |
this deprecation warning, change your ZCML to use the new name, |
|
4644 |
e.g. change:: |
|
4645 |
|
|
4646 |
<utility |
|
4647 |
provides="repoze.bfg.interfaces.ISecurityPolicy" |
|
4648 |
factory="repoze.bfg.security.RepozeWhoIdentityACLSecurityPolicy" |
|
4649 |
/> |
|
4650 |
|
|
4651 |
To:: |
|
4652 |
|
|
4653 |
<utility |
|
4654 |
provides="repoze.bfg.interfaces.ISecurityPolicy" |
|
4655 |
factory="repoze.bfg.security.WhoACLSecurityPolicy" |
|
4656 |
/> |
|
4657 |
|
|
4658 |
0.8a4 (2009-05-04) |
|
4659 |
================== |
|
4660 |
|
|
4661 |
Features |
|
4662 |
-------- |
|
4663 |
|
|
4664 |
- ``zope.testing`` is no longer a direct dependency, although our |
|
4665 |
dependencies (such as ``zope.interface``, ``repoze.zcml``, etc) |
|
4666 |
still depend on it. |
|
4667 |
|
|
4668 |
- Tested on Google App Engine. Added a tutorial to the documentation |
|
4669 |
explaining how to deploy a BFG app to GAE. |
|
4670 |
|
|
4671 |
Backwards Incompatibilities |
|
4672 |
--------------------------- |
|
4673 |
|
|
4674 |
- Applications which rely on ``zope.testing.cleanup.cleanUp`` in unit |
|
4675 |
tests can still use that function indefinitely. However, for |
|
4676 |
maximum forward compatibility, they should import ``cleanUp`` from |
|
4677 |
``repoze.bfg.testing`` instead of from ``zope.testing.cleanup``. |
|
4678 |
The BFG paster templates and docs have been changed to use this |
|
4679 |
function instead of the ``zope.testing.cleanup`` version. |
|
4680 |
|
|
4681 |
0.8a3 (2009-05-03) |
|
4682 |
=================== |
|
4683 |
|
|
4684 |
Features |
|
4685 |
-------- |
|
4686 |
|
|
4687 |
- Don't require a successful import of ``zope.testing`` at BFG |
|
4688 |
application runtime. This allows us to get rid of ``zope.testing`` |
|
4689 |
on platforms like GAE which have file limits. |
|
4690 |
|
|
4691 |
0.8a2 (2009-05-02) |
|
4692 |
================== |
|
4693 |
|
|
4694 |
Features |
|
4695 |
-------- |
|
4696 |
|
|
4697 |
- We no longer include the ``configure.zcml`` of the ``chameleon.zpt`` |
|
4698 |
package within the ``configure.zcml`` of the "repoze.bfg.includes" |
|
4699 |
package. This has been a no-op for some time now. |
|
4700 |
|
|
4701 |
- The ``repoze.bfg.chameleon_zpt`` package no longer imports from |
|
4702 |
``chameleon.zpt`` at module scope, deferring the import until later |
|
4703 |
within a method call. The ``chameleon.zpt`` package can't be |
|
4704 |
imported on platforms like GAE. |
|
4705 |
|
|
4706 |
0.8a1 (2009-05-02) |
|
4707 |
================== |
|
4708 |
|
|
4709 |
Deprecation Warning and Import Alias Removals |
|
4710 |
--------------------------------------------- |
|
4711 |
|
|
4712 |
- Since version 0.6.1, a deprecation warning has been emitted when the |
|
4713 |
name ``model_url`` is imported from the ``repoze.bfg.traversal`` |
|
4714 |
module. This import alias (and the deprecation warning) has been |
|
4715 |
removed. Any import of the ``model_url`` function will now need to |
|
4716 |
be done from ``repoze.bfg.url``; any import of the name |
|
4717 |
``model_url`` from ``repoze.bfg.traversal`` will now fail. This was |
|
4718 |
done to remove a dependency on zope.deferredimport. |
|
4719 |
|
|
4720 |
- Since version 0.6.5, a deprecation warning has been emitted when the |
|
4721 |
name ``RoutesModelTraverser`` is imported from the |
|
4722 |
``repoze.bfg.traversal`` module. This import alias (and the |
|
4723 |
deprecation warning) has been removed. Any import of the |
|
4724 |
``RoutesModelTraverser`` class will now need to be done from |
|
4725 |
``repoze.bfg.urldispatch``; any import of the name |
|
4726 |
``RoutesModelTraverser`` from ``repoze.bfg.traversal`` will now |
|
4727 |
fail. This was done to remove a dependency on zope.deferredimport. |
|
4728 |
|
|
4729 |
Features |
|
4730 |
-------- |
|
4731 |
|
|
4732 |
- This release of ``repoze.bfg`` is "C-free". This means it has no |
|
4733 |
hard dependencies on any software that must be compiled from C |
|
4734 |
source at installation time. In particular, ``repoze.bfg`` no |
|
4735 |
longer depends on the ``lxml`` package. |
|
4736 |
|
|
4737 |
This change has introduced some backwards incompatibilities, |
|
4738 |
described in the "Backwards Incompatibilities" section below. |
|
4739 |
|
|
4740 |
- This release was tested on Windows XP. It appears to work fine and |
|
4741 |
all the tests pass. |
|
4742 |
|
|
4743 |
Backwards Incompatibilities |
|
4744 |
--------------------------- |
|
4745 |
|
|
4746 |
Incompatibilities related to making ``repoze.bfg`` "C-free": |
|
4747 |
|
|
4748 |
- Removed the ``repoze.bfg.chameleon_genshi`` module, and thus support |
|
4749 |
for Genshi-style chameleon templates. Genshi-style Chameleon |
|
4750 |
templates depend upon ``lxml``, which is implemented in C (as |
|
4751 |
opposed to pure Python) and the ``repoze.bfg`` core is "C-free" as |
|
4752 |
of this release. You may get Genshi-style Chameleon support back by |
|
4753 |
installing the ``repoze.bfg.chameleon_genshi`` package availalable |
|
4754 |
from http://svn.repoze.org/repoze.bfg.chameleon_genshi (also |
|
4755 |
available in the index at http://dist.repoze.org/bfg/0.8/simple). |
|
4756 |
All existing code that depended on the ``chameleon_genshi`` module |
|
4757 |
prior to this release of ``repoze.bfg`` should work without change |
|
4758 |
after this addon is installed. |
|
4759 |
|
|
4760 |
- Removed the ``repoze.bfg.xslt`` module and thus support for XSL |
|
4761 |
templates. The ``repoze.bfg.xslt`` module depended upon ``lxml``, |
|
4762 |
which is implemented in C, and the ``repoze.bfg`` core is "C-free" |
|
4763 |
as of this release. You bay get XSL templating back by installing |
|
4764 |
the ``repoze.bfg.xslt`` package available from |
|
4765 |
http://svn.repoze.org/repoze.bfg.xslt/ (also available in the index |
|
4766 |
at http://dist.repoze.org/bfg/0.8/simple). All existing code that |
|
4767 |
depended upon the ``xslt`` module prior to this release of |
|
4768 |
``repoze.bfg`` should work without modification after this addon is |
|
4769 |
installed. |
|
4770 |
|
|
4771 |
- Removed the ``repoze.bfg.interfaces.INodeTemplateRenderer`` |
|
4772 |
interface and the an old b/w compat aliases from that interface to |
|
4773 |
``repoze.bfg.interfaces.INodeTemplate``. This interface must now be |
|
4774 |
imported from the ``repoze.bfg.xslt.interfaces`` package after |
|
4775 |
installation of the ``repoze.bfg.xslt`` addon package described |
|
4776 |
above as ``repoze.bfg.interfaces.INodeTemplateRenderer``. This |
|
4777 |
interface was never part of any public API. |
|
4778 |
|
|
4779 |
Other backwards incompatibilities: |
|
4780 |
|
|
4781 |
- The ``render_template`` function in ``repoze.bfg.chameleon_zpt`` |
|
4782 |
returns Unicode instead of a string. Likewise, the individual |
|
4783 |
values returned by the iterable created by the |
|
4784 |
``render_template_to_iterable`` function are also each Unicode. |
|
4785 |
This is actually a backwards incompatibility inherited from our new |
|
4786 |
use of the combination of ``chameleon.core`` 1.0b32 (the |
|
4787 |
non-lxml-depending version) and ``chameleon.zpt`` 1.0b16+ ; the |
|
4788 |
``chameleon.zpt`` PageTemplateFile implementation used to return a |
|
4789 |
string, but now returns Unicode. |
|
4790 |
|
|
4791 |
0.7.1 (2009-05-01) |
|
4792 |
================== |
|
4793 |
|
|
4794 |
Index-Related |
|
4795 |
------------- |
|
4796 |
|
|
4797 |
- The canonical package index location for ``repoze.bfg`` has changed. |
|
4798 |
The "old" index (http://dist.repoze.org/lemonade/dev/simple) has |
|
4799 |
been superseded by a new index location |
|
4800 |
(`http://dist.repoze.org/bfg/current/simple |
|
4801 |
<http://dist.repoze.org/bfg/current/simple>`_). The installation |
|
4802 |
documentation has been updated as well as the ``setup.cfg`` file in |
|
4803 |
this package. The "lemonade" index still exists, but it is not |
|
4804 |
guaranteed to have the latest BFG software in it, nor will it be |
|
4805 |
maintained in the future. |
|
4806 |
|
|
4807 |
Features |
|
4808 |
-------- |
|
4809 |
|
|
4810 |
- The "paster create" templates have been modified to use links to the |
|
4811 |
new "bfg.repoze.org" and "docs.repoze.org" websites. |
|
4812 |
|
|
4813 |
- Added better documentation for virtual hosting at a URL prefix |
|
4814 |
within the virtual hosting docs chapter. |
|
4815 |
|
|
4816 |
- The interface for ``repoze.bfg.interfaces.ITraverser`` and the |
|
4817 |
built-in implementations that implement the interface |
|
4818 |
(``repoze.bfg.traversal.ModelGraphTraverser``, and |
|
4819 |
``repoze.bfg.urldispatch.RoutesModelTraverser``) now expect the |
|
4820 |
``__call__`` method of an ITraverser to return 3 additional |
|
4821 |
arguments: ``traversed``, ``virtual_root``, and |
|
4822 |
``virtual_root_path`` (the old contract was that the ``__call__`` |
|
4823 |
method of an ITraverser returned; three arguments, the contract new |
|
4824 |
is that it returns six). ``traversed`` will be a sequence of |
|
4825 |
Unicode names that were traversed (including the virtual root path, |
|
4826 |
if any) or ``None`` if no traversal was performed, ``virtual_root`` |
|
4827 |
will be a model object representing the virtual root (or the |
|
4828 |
physical root if traversal was not performed), and |
|
4829 |
``virtual_root_path`` will be a sequence representing the virtual |
|
4830 |
root path (a sequence of Unicode names) or ``None`` if traversal was |
|
4831 |
not performed. |
|
4832 |
|
|
4833 |
Six arguments are now returned from BFG ITraversers. They are |
|
4834 |
returned in this order: ``context``, ``view_name``, ``subpath``, |
|
4835 |
``traversed``, ``virtual_root``, and ``virtual_root_path``. |
|
4836 |
|
|
4837 |
Places in the BFG code which called an ITraverser continue to accept |
|
4838 |
a 3-argument return value, although BFG will generate and log a |
|
4839 |
warning when one is encountered. |
|
4840 |
|
|
4841 |
- The request object now has the following attributes: ``traversed`` |
|
4842 |
(the sequence of names traversed or ``None`` if traversal was not |
|
4843 |
performed), ``virtual_root`` (the model object representing the |
|
4844 |
virtual root, including the virtual root path if any), and |
|
4845 |
``virtual_root_path`` (the seuquence of names representing the |
|
4846 |
virtual root path or ``None`` if traversal was not performed). |
|
4847 |
|
|
4848 |
- A new decorator named ``wsgiapp2`` was added to the |
|
4849 |
``repoze.bfg.wsgi`` module. This decorator performs the same |
|
4850 |
function as ``repoze.bfg.wsgi.wsgiapp`` except it fixes up the |
|
4851 |
``SCRIPT_NAME``, and ``PATH_INFO`` environment values before |
|
4852 |
invoking the WSGI subapplication. |
|
4853 |
|
|
4854 |
- The ``repoze.bfg.testing.DummyRequest`` object now has default |
|
4855 |
attributes for ``traversed``, ``virtual_root``, and |
|
4856 |
``virtual_root_path``. |
|
4857 |
|
|
4858 |
- The RoutesModelTraverser now behaves more like the Routes |
|
4859 |
"RoutesMiddleware" object when an element in the match dict is named |
|
4860 |
``path_info`` (usually when there's a pattern like |
|
4861 |
``http://foo/*path_info``). When this is the case, the |
|
4862 |
``PATH_INFO`` environment variable is set to the value in the match |
|
4863 |
dict, and the ``SCRIPT_NAME`` is appended to with the prefix of the |
|
4864 |
original ``PATH_INFO`` not including the value of the new variable. |
|
4865 |
|
|
4866 |
- The notfound debug now shows the traversed path, the virtual root, |
|
4867 |
and the virtual root path too. |
|
4868 |
|
|
4869 |
- Speed up / clarify 'traversal' module's 'model_path', 'model_path_tuple', |
|
4870 |
and '_model_path_list' functions. |
|
4871 |
|
|
4872 |
Backwards Incompatibilities |
|
4873 |
--------------------------- |
|
4874 |
|
|
4875 |
- In previous releases, the ``repoze.bfg.url.model_url``, |
|
4876 |
``repoze.bfg.traversal.model_path`` and |
|
4877 |
``repoze.bfg.traversal.model_path_tuple`` functions always ignored |
|
4878 |
the ``__name__`` argument of the root object in a model graph ( |
|
4879 |
effectively replacing it with a leading ``/`` in the returned value) |
|
4880 |
when a path or URL was generated. The code required to perform this |
|
4881 |
operation was not efficient. As of this release, the root object in |
|
4882 |
a model graph *must* have a ``__name__`` attribute that is either |
|
4883 |
``None`` or the empty string (``''``) for URLs and paths to be |
|
4884 |
generated properly from these APIs. If your root model object has a |
|
4885 |
``__name__`` argument that is not one of these values, you will need |
|
4886 |
to change your code for URLs and paths to be generated properly. If |
|
4887 |
your model graph has a root node with a string ``__name__`` that is |
|
4888 |
not null, the value of ``__name__`` will be prepended to every path |
|
4889 |
and URL generated. |
|
4890 |
|
|
4891 |
- The ``repoze.bfg.location.LocationProxy`` class and the |
|
4892 |
``repoze.bfg.location.ClassAndInstanceDescr`` class have both been |
|
4893 |
removed in order to be able to eventually shed a dependency on |
|
4894 |
``zope.proxy``. Neither of these classes was ever an API. |
|
4895 |
|
|
4896 |
- In all previous releases, the ``repoze.bfg.location.locate`` |
|
4897 |
function worked like so: if a model did not explicitly provide the |
|
4898 |
``repoze.bfg.interfaces.ILocation`` interface, ``locate`` returned a |
|
4899 |
``LocationProxy`` object representing ``model`` with its |
|
4900 |
``__parent__`` attribute assigned to ``parent`` and a ``__name__`` |
|
4901 |
attribute assigned to ``__name__``. In this release, the |
|
4902 |
``repoze.bfg.location.locate`` function simply jams the ``__name__`` |
|
4903 |
and ``__parent__`` attributes on to the supplied model |
|
4904 |
unconditionally, no matter if the object implements ILocation or |
|
4905 |
not, and it never returns a proxy. This was done because the |
|
4906 |
LocationProxy behavior has now moved into an add-on package |
|
4907 |
(``repoze.bfg.traversalwrapper``), in order to eventually be able to |
|
4908 |
shed a dependency on ``zope.proxy``. |
|
4909 |
|
|
4910 |
- In all previous releases, by default, if traversal was used (as |
|
4911 |
opposed to URL-dispatch), and the root object supplied |
|
4912 |
the``repoze.bfg.interfaces.ILocation`` interface, but the children |
|
4913 |
returned via its ``__getitem__`` returned an object that did not |
|
4914 |
implement the same interface, ``repoze.bfg`` provided some |
|
4915 |
implicit help during traversal. This traversal feature wrapped |
|
4916 |
subobjects from the root (and thereafter) that did not implement |
|
4917 |
``ILocation`` in proxies which automatically provided them with a |
|
4918 |
``__name__`` and ``__parent__`` attribute based on the name being |
|
4919 |
traversed and the previous object traversed. This feature has now |
|
4920 |
been removed from the base ``repoze.bfg`` package for purposes of |
|
4921 |
eventually shedding a dependency on ``zope.proxy``. |
|
4922 |
|
|
4923 |
In order to re-enable the wrapper behavior for older applications |
|
4924 |
which cannot be changed, register the "traversalwrapper" |
|
4925 |
``ModelGraphTraverser`` as the traversal policy, rather than the |
|
4926 |
default ``ModelGraphTraverser``. To use this feature, you will need |
|
4927 |
to install the ``repoze.bfg.traversalwrapper`` package (an add-on |
|
4928 |
package, available at |
|
4929 |
http://svn.repoze.org/repoze.bfg.traversalwrapper) Then change your |
|
4930 |
application's ``configure.zcml`` to include the following stanza: |
|
4931 |
|
|
4932 |
<adapter |
|
4933 |
factory="repoze.bfg.traversalwrapper.ModelGraphTraverser" |
|
4934 |
provides="repoze.bfg.interfaces.ITraverserFactory" |
|
4935 |
for="*" |
|
4936 |
/> |
|
4937 |
|
|
4938 |
When this ITraverserFactory is used instead of the default, no |
|
4939 |
object in the graph (even the root object) must supply a |
|
4940 |
``__name__`` or ``__parent__`` attribute. Even if subobjects |
|
4941 |
returned from the root *do* implement the ILocation interface, |
|
4942 |
these will still be wrapped in proxies that override the object's |
|
4943 |
"real" ``__parent__`` and ``__name__`` attributes. |
|
4944 |
|
|
4945 |
See also changes to the "Models" chapter of the documentation (in |
|
4946 |
the "Location-Aware Model Instances") section. |
|
4947 |
|
|
4948 |
0.7.0 (2009-04-11) |
|
4949 |
================== |
|
4950 |
|
|
4951 |
Bug Fixes |
|
4952 |
--------- |
|
4953 |
|
|
4954 |
- Fix a bug in ``repoze.bfg.wsgi.HTTPException``: the content length |
|
4955 |
was returned as an int rather than as a string. |
|
4956 |
|
|
4957 |
- Add explicit dependencies on ``zope.deferredimport``, |
|
4958 |
``zope.deprecation``, and ``zope.proxy`` for forward compatibility |
|
4959 |
reasons (``zope.component`` will stop relying on |
|
4960 |
``zope.deferredimport`` soon and although we use it directly, it's |
|
4961 |
only a transitive dependency, and ''zope.deprecation`` and |
|
4962 |
``zope.proxy`` are used directly even though they're only transitive |
|
4963 |
dependencies as well). |
|
4964 |
|
|
4965 |
- Using ``model_url`` or ``model_path`` against a broken model graph |
|
4966 |
(one with models that had a non-root model with a ``__name__`` of |
|
4967 |
``None``) caused an inscrutable error to be thrown: ( if not |
|
4968 |
``_must_quote[cachekey].search(s): TypeError: expected string or |
|
4969 |
buffer``). Now URLs and paths generated against graphs that have |
|
4970 |
None names in intermediate nodes will replace the None with the |
|
4971 |
empty string, and, as a result, the error won't be raised. Of |
|
4972 |
course the URL or path will still be bogus. |
|
4973 |
|
|
4974 |
Features |
|
4975 |
-------- |
|
4976 |
|
|
4977 |
- Make it possible to have ``testing.DummyTemplateRenderer`` return |
|
4978 |
some nondefault string representation. |
|
4979 |
|
|
4980 |
- Added a new ``anchor`` keyword argument to ``model_url``. If |
|
4981 |
``anchor`` is present, its string representation will be used |
|
4982 |
as a named anchor in the generated URL (e.g. if ``anchor`` is |
|
4983 |
passed as ``foo`` and the model URL is |
|
4984 |
``http://example.com/model/url``, the generated URL will be |
|
4985 |
``http://example.com/model/url#foo``). |
|
4986 |
|
|
4987 |
Backwards Incompatibilities |
|
4988 |
--------------------------- |
|
4989 |
|
|
4990 |
- The default request charset encoding is now ``utf-8``. As a result, |
|
4991 |
the request machinery will attempt to decode values from the utf-8 |
|
4992 |
encoding to Unicode automatically when they are obtained via |
|
4993 |
``request.params``, ``request.GET``, and ``request.POST``. The |
|
4994 |
previous behavior of BFG was to return a bytestring when a value was |
|
4995 |
accessed in this manner. This change will break form handling code |
|
4996 |
in apps that rely on values from those APIs being considered |
|
4997 |
bytestrings. If you are manually decoding values from form |
|
4998 |
submissions in your application, you'll either need to change the |
|
4999 |
code that does that to expect Unicode values from |
|
5000 |
``request.params``, ``request.GET`` and ``request.POST``, or you'll |
|
5001 |
need to explicitly reenable the previous behavior. To reenable the |
|
5002 |
previous behavior, add the following to your application's |
|
5003 |
``configure.zcml``:: |
|
5004 |
|
|
5005 |
<subscriber for="repoze.bfg.interfaces.INewRequest" |
|
5006 |
handler="repoze.bfg.request.make_request_ascii"/> |
|
5007 |
|
|
5008 |
See also the documentation in the "Views" chapter of the BFG docs |
|
5009 |
entitled "Using Views to Handle Form Submissions (Unicode and |
|
5010 |
Character Set Issues)". |
|
5011 |
|
|
5012 |
Documentation |
|
5013 |
------------- |
|
5014 |
|
|
5015 |
- Add a section to the narrative Views chapter entitled "Using Views |
|
5016 |
to Handle Form Submissions (Unicode and Character Set Issues)" |
|
5017 |
explaining implicit decoding of form data values. |
|
5018 |
|
|
5019 |
0.6.9 (2009-02-16) |
|
5020 |
================== |
|
5021 |
|
|
5022 |
Bug Fixes |
|
5023 |
--------- |
|
5024 |
|
|
5025 |
- lru cache was unstable under concurrency (big surprise!) when it |
|
5026 |
tried to redelete a key in the cache that had already been deleted. |
|
5027 |
Symptom: line 64 in put:del data[oldkey]:KeyError: '/some/path'. |
|
5028 |
Now we just ignore the key error if we can't delete the key (it has |
|
5029 |
already been deleted). |
|
5030 |
|
|
5031 |
- Empty location names in model paths when generating a URL using |
|
5032 |
``repoze.bfg.model_url`` based on a model obtained via traversal are |
|
5033 |
no longer ignored in the generated URL. This means that if a |
|
5034 |
non-root model object has a ``__name__`` of ``''``, the URL will |
|
5035 |
reflect it (e.g. ``model_url`` will generate ``http://foo/bar//baz`` |
|
5036 |
if an object with the ``__name__`` of ``''`` is a child of bar and |
|
5037 |
the parent of baz). URLs generated with empty path segments are, |
|
5038 |
however, still irresolveable by the model graph traverser on request |
|
5039 |
ingress (the traverser strips empty path segment names). |
|
5040 |
|
|
5041 |
Features |
|
5042 |
-------- |
|
5043 |
|
|
5044 |
- Microspeedups of ``repoze.bfg.traversal.model_path``, |
|
5045 |
``repoze.bfg.traversal.model_path_tuple``, |
|
5046 |
``repoze.bfg.traversal.quote_path_segment``, and |
|
5047 |
``repoze.bfg.url.urlencode``. |
|
5048 |
|
|
5049 |
- add zip_safe = false to setup.cfg. |
|
5050 |
|
|
5051 |
Documentation |
|
5052 |
------------- |
|
5053 |
|
|
5054 |
- Add a note to the ``repoze.bfg.traversal.quote_path_segment`` API |
|
5055 |
docs about caching of computed values. |
|
5056 |
|
|
5057 |
Implementation Changes |
|
5058 |
---------------------- |
|
5059 |
|
|
5060 |
- Simplification of |
|
5061 |
``repoze.bfg.traversal.TraversalContextURL.__call__`` (it now uses |
|
5062 |
``repoze.bfg.traversal.model_path`` instead of rolling its own |
|
5063 |
path-generation). |
|
5064 |
|
|
5065 |
0.6.8 (2009-02-05) |
|
5066 |
================== |
|
5067 |
|
|
5068 |
Backwards Incompatibilities |
|
5069 |
--------------------------- |
|
5070 |
|
|
5071 |
- The ``repoze.bfg.traversal.model_path`` API now returns a *quoted* |
|
5072 |
string rather than a string represented by series of unquoted |
|
5073 |
elements joined via ``/`` characters. Previously it returned a |
|
5074 |
string or unicode object representing the model path, with each |
|
5075 |
segment name in the path joined together via ``/`` characters, |
|
5076 |
e.g. ``/foo /bar``. Now it returns a string, where each segment is |
|
5077 |
a UTF-8 encoded and URL-quoted element e.g. ``/foo%20/bar``. This |
|
5078 |
change was (as discussed briefly on the repoze-dev maillist) |
|
5079 |
necessary to accomodate model objects which themselves have |
|
5080 |
``__name__`` attributes that contain the ``/`` character. |
|
5081 |
|
|
5082 |
For people that have no models that have high-order Unicode |
|
5083 |
``__name__`` attributes or ``__name__`` attributes with values that |
|
5084 |
require URL-quoting with in their model graphs, this won't cause any |
|
5085 |
issue. However, if you have code that currently expects |
|
5086 |
``model_path`` to return an unquoted string, or you have an existing |
|
5087 |
application with data generated via the old method, and you're too |
|
5088 |
lazy to change anything, you may wish replace the BFG-imported |
|
5089 |
``model_path`` in your code with this function (this is the code of |
|
5090 |
the "old" ``model_path`` implementation):: |
|
5091 |
|
|
5092 |
from repoze.bfg.location import lineage |
|
5093 |
|
|
5094 |
def i_am_too_lazy_to_move_to_the_new_model_path(model, *elements): |
|
5095 |
rpath = [] |
|
5096 |
for location in lineage(model): |
|
5097 |
if location.__name__: |
|
5098 |
rpath.append(location.__name__) |
|
5099 |
path = '/' + '/'.join(reversed(rpath)) |
|
5100 |
if elements: |
|
5101 |
suffix = '/'.join(elements) |
|
5102 |
path = '/'.join([path, suffix]) |
|
5103 |
return path |
|
5104 |
|
|
5105 |
- The ``repoze.bfg.traversal.find_model`` API no longer implicitly |
|
5106 |
converts unicode representations of a full path passed to it as a |
|
5107 |
Unicode object into a UTF-8 string. Callers should either use |
|
5108 |
prequoted path strings returned by |
|
5109 |
``repoze.bfg.traversal.model_path``, or tuple values returned by the |
|
5110 |
result of ``repoze.bfg.traversal.model_path_tuple`` or they should |
|
5111 |
use the guidelines about passing a string ``path`` argument |
|
5112 |
described in the ``find_model`` API documentation. |
|
5113 |
|
|
5114 |
Bugfixes |
|
5115 |
-------- |
|
5116 |
|
|
5117 |
- Each argument contained in ``elements`` passed to |
|
5118 |
``repoze.bfg.traversal.model_path`` will now have any ``/`` |
|
5119 |
characters contained within quoted to ``%2F`` in the returned |
|
5120 |
string. Previously, ``/`` characters in elements were left unquoted |
|
5121 |
(a bug). |
|
5122 |
|
|
5123 |
Features |
|
5124 |
-------- |
|
5125 |
|
|
5126 |
- A ``repoze.bfg.traversal.model_path_tuple`` API was added. This API |
|
5127 |
is an alternative to ``model_path`` (which returns a string); |
|
5128 |
``model_path_tuple`` returns a model path as a tuple (much like |
|
5129 |
Zope's ``getPhysicalPath``). |
|
5130 |
|
|
5131 |
- A ``repoze.bfg.traversal.quote_path_segment`` API was added. This |
|
5132 |
API will quote an individual path segment (string or unicode |
|
5133 |
object). See the ``repoze.bfg.traversal`` API documentation for |
|
5134 |
more information. |
|
5135 |
|
|
5136 |
- The ``repoze.bfg.traversal.find_model`` API now accepts "path |
|
5137 |
tuples" (see the above note regarding ``model_path_tuple``) as well |
|
5138 |
as string path representations (from |
|
5139 |
``repoze.bfg.traversal.model_path``) as a ``path`` argument. |
|
5140 |
|
|
5141 |
- Add ` `renderer`` argument (defaulting to None) to |
|
5142 |
``repoze.bfg.testing.registerDummyRenderer``. This makes it |
|
5143 |
possible, for instance, to register a custom renderer that raises an |
|
5144 |
exception in a unit test. |
|
5145 |
|
|
5146 |
Implementation Changes |
|
5147 |
---------------------- |
|
5148 |
|
|
5149 |
- Moved _url_quote function back to ``repoze.bfg.traversal`` from |
|
5150 |
``repoze.bfg.url``. This is not an API. |
|
5151 |
|
|
5152 |
0.6.7 (2009-01-27) |
|
5153 |
================== |
|
5154 |
|
|
5155 |
Features |
|
5156 |
-------- |
|
5157 |
|
|
5158 |
- The ``repoze.bfg.url.model_url`` API now works against contexts |
|
5159 |
derived from Routes URL dispatch (``Routes.util.url_for`` is called |
|
5160 |
under the hood). |
|
5161 |
|
|
5162 |
- "Virtual root" support for traversal-based applications has been |
|
5163 |
added. Virtual root support is useful when you'd like to host some |
|
5164 |
model in a ``repoze.bfg`` model graph as an application under a |
|
5165 |
URL pathname that does not include the model path itself. For more |
|
5166 |
information, see the (new) "Virtual Hosting" chapter in the |
|
5167 |
documentation. |
|
5168 |
|
|
5169 |
- A ``repoze.bfg.traversal.virtual_root`` API has been added. When |
|
5170 |
called, it returns the virtual root object (or the physical root |
|
5171 |
object if no virtual root has been specified). |
|
5172 |
|
|
5173 |
Implementation Changes |
|
5174 |
---------------------- |
|
5175 |
|
|
5176 |
- ``repoze.bfg.traversal.RoutesModelTraverser`` has been moved to |
|
5177 |
``repoze.bfg.urldispatch``. |
|
5178 |
|
|
5179 |
- ``model_url`` URL generation is now performed via an adapter lookup |
|
5180 |
based on the context and the request. |
|
5181 |
|
|
5182 |
- ZCML which registers two adapters for the ``IContextURL`` interface |
|
5183 |
has been added to the configure.zcml in ``repoze.bfg.includes``. |
|
5184 |
|
|
5185 |
0.6.6 (2009-01-26) |
|
5186 |
================== |
|
5187 |
|
|
5188 |
Implementation Changes |
|
5189 |
---------------------- |
|
5190 |
|
|
5191 |
- There is an indirection in ``repoze.bfg.url.model_url`` now that |
|
5192 |
consults a utility to generate the base model url (without extra |
|
5193 |
elements or a query string). Eventually this will service virtual |
|
5194 |
hosting; for now it's undocumented and should not be hooked. |
|
5195 |
|
|
5196 |
0.6.5 (2009-01-26) |
|
5197 |
================== |
|
5198 |
|
|
5199 |
Features |
|
5200 |
-------- |
|
5201 |
|
|
5202 |
- You can now override the NotFound and Unauthorized responses that |
|
5203 |
``repoze.bfg`` generates when a view cannot be found or cannot be |
|
5204 |
invoked due to lack of permission. See the "ZCML Hooks" chapter in |
|
5205 |
the docs for more information. |
|
5206 |
|
|
5207 |
- Added Routes ZCML directive attribute explanations in documentation. |
|
5208 |
|
|
5209 |
- Added a ``traversal_path`` API to the traversal module; see the |
|
5210 |
"traversal" API chapter in the docs. This was a function previously |
|
5211 |
known as ``split_path`` that was not an API but people were using it |
|
5212 |
anyway. Unlike ``split_path``, it now returns a tuple instead of a |
|
5213 |
list (as its values are cached). |
|
5214 |
|
|
5215 |
Behavior Changes |
|
5216 |
---------------- |
|
5217 |
|
|
5218 |
- The ``repoze.bfg.view.render_view_to_response`` API will no longer |
|
5219 |
raise a ValueError if an object returned by a view function it calls |
|
5220 |
does not possess certain attributes (``headerlist``, ``app_iter``, |
|
5221 |
``status``). This API used to attempt to perform a check using the |
|
5222 |
``is_response`` function in ``repoze.bfg.view``, and raised a |
|
5223 |
``ValueError`` if the ``is_response`` check failed. The |
|
5224 |
responsibility is now the caller's to ensure that the return value |
|
5225 |
from a view function is a "real" response. |
|
5226 |
|
|
5227 |
- WSGI environ dicts passed to ``repoze.bfg`` 's Router must now |
|
5228 |
contain a REQUEST_METHOD key/value; if they do not, a KeyError will |
|
5229 |
be raised (speed). |
|
5230 |
|
|
5231 |
- It is no longer permissible to pass a "nested" list of principals to |
|
5232 |
``repoze.bfg.ACLAuthorizer.permits`` (e.g. ``['fred', ['larry', |
|
5233 |
'bob']]``). The principals list must be fully expanded. This |
|
5234 |
feature was never documented, and was never an API, so it's not a |
|
5235 |
backwards incompatibility. |
|
5236 |
|
|
5237 |
- It is no longer permissible for a security ACE to contain a "nested" |
|
5238 |
list of permissions (e.g. ``(Allow, Everyone, ['read', ['view', |
|
5239 |
['write', 'manage']]])`)`. The list must instead be fully expanded |
|
5240 |
(e.g. ``(Allow, Everyone, ['read', 'view', 'write', 'manage])``). This |
|
5241 |
feature was never documented, and was never an API, so it's not a |
|
5242 |
backwards incompatibility. |
|
5243 |
|
|
5244 |
- The ``repoze.bfg.urldispatch.RoutesRootFactory`` now injects the |
|
5245 |
``wsgiorg.routing_args`` environment variable into the environ when |
|
5246 |
a route matches. This is a tuple of ((), routing_args) where |
|
5247 |
routing_args is the value that comes back from the routes mapper |
|
5248 |
match (the "match dict"). |
|
5249 |
|
|
5250 |
- The ``repoze.bfg.traversal.RoutesModelTraverser`` class now wants to |
|
5251 |
obtain the ``view_name`` and ``subpath`` from the |
|
5252 |
``wsgiorgs.routing_args`` environment variable. It falls back to |
|
5253 |
obtaining these from the context for backwards compatibility. |
|
5254 |
|
|
5255 |
Implementation Changes |
|
5256 |
---------------------- |
|
5257 |
|
|
5258 |
- Get rid of ``repoze.bfg.security.ACLAuthorizer``: the |
|
5259 |
``ACLSecurityPolicy`` now does what it did inline. |
|
5260 |
|
|
5261 |
- Get rid of ``repoze.bfg.interfaces.NoAuthorizationInformation`` |
|
5262 |
exception: it was used only by ``ACLAuthorizer``. |
|
5263 |
|
|
5264 |
- Use a homegrown NotFound error instead of ``webob.exc.HTTPNotFound`` |
|
5265 |
(the latter is slow). |
|
5266 |
|
|
5267 |
- Use a homegrown Unauthorized error instead of |
|
5268 |
``webob.exc.Unauthorized`` (the latter is slow). |
|
5269 |
|
|
5270 |
- the ``repoze.bfg.lru.lru_cached`` decorator now uses functools.wraps |
|
5271 |
in order to make documentation of LRU-cached functions possible. |
|
5272 |
|
|
5273 |
- Various speed micro-tweaks. |
|
5274 |
|
|
5275 |
Bug Fixes |
|
5276 |
--------- |
|
5277 |
|
|
5278 |
- ``repoze.bfg.testing.DummyModel`` did not have a ``get`` method; |
|
5279 |
it now does. |
|
5280 |
|
|
5281 |
0.6.4 (2009-01-23) |
|
5282 |
================== |
|
5283 |
|
|
5284 |
Backwards Incompatibilities |
|
5285 |
--------------------------- |
|
5286 |
|
|
5287 |
- The ``unicode_path_segments`` configuration variable and the |
|
5288 |
``BFG_UNICODE_PATH_SEGMENTS`` configuration variable have been |
|
5289 |
removed. Path segments are now always passed to model |
|
5290 |
``__getitem__`` methods as unicode. "True" has been the default for |
|
5291 |
this setting since 0.5.4, but changing this configuration setting to |
|
5292 |
false allowed you to go back to passing raw path element strings to |
|
5293 |
model ``__getitem__`` methods. Removal of this knob services a |
|
5294 |
speed goal (we get about +80 req/s by removing the check), and it's |
|
5295 |
clearer just to always expect unicode path segments in model |
|
5296 |
``__getitem__`` methods. |
|
5297 |
|
|
5298 |
Implementation Changes |
|
5299 |
---------------------- |
|
5300 |
|
|
5301 |
- ``repoze.bfg.traversal.split_path`` now also handles decoding |
|
5302 |
path segments to unicode (for speed, because its results are |
|
5303 |
cached). |
|
5304 |
|
|
5305 |
- ``repoze.bfg.traversal.step`` was made a method of the |
|
5306 |
ModelGraphTraverser. |
|
5307 |
|
|
5308 |
- Use "precooked" Request subclasses |
|
5309 |
(e.g. ``repoze.bfg.request.GETRequest``) that correspond to HTTP |
|
5310 |
request methods within ``router.py`` when constructing a request |
|
5311 |
object rather than using ``alsoProvides`` to attach the proper |
|
5312 |
interface to an unsubclassed ``webob.Request``. This pattern is |
|
5313 |
purely an optimization (e.g. preventing calls to ``alsoProvides`` |
|
5314 |
means the difference between 590 r/s and 690 r/s on a MacBook 2GHz). |
|
5315 |
|
|
5316 |
- Tease out an extra 4% performance boost by changing the Router; |
|
5317 |
instead of using imported ZCA APIs, use the same APIs directly |
|
5318 |
against the registry that is an attribute of the Router. |
|
5319 |
|
|
5320 |
- The registry used by BFG is now a subclass of |
|
5321 |
``zope.component.registry.Components`` (defined as |
|
5322 |
``repoze.bfg.registry.Registry``); it has a ``notify`` method, a |
|
5323 |
``registerSubscriptionAdapter`` and a ``registerHandler`` method. |
|
5324 |
If no subscribers are registered via ``registerHandler`` or |
|
5325 |
``registerSubscriptionAdapter``, ``notify`` is a noop for speed. |
|
5326 |
|
|
5327 |
- The Allowed and Denied classes in ``repoze.bfg.security`` now are |
|
5328 |
lazier about constructing the representation of a reason message for |
|
5329 |
speed; ``repoze.bfg.view_execution_permitted`` takes advantage of |
|
5330 |
this. |
|
5331 |
|
|
5332 |
- The ``is_response`` check was sped up by about half at the expense |
|
5333 |
of making its code slightly uglier. |
|
5334 |
|
|
5335 |
New Modules |
|
5336 |
----------- |
|
5337 |
|
|
5338 |
- ``repoze.bfg.lru`` implements an LRU cache class and a decorator for |
|
5339 |
internal use. |
|
5340 |
|
|
5341 |
0.6.3 (2009-01-19) |
|
5342 |
================== |
|
5343 |
|
|
5344 |
Bug Fixes |
|
5345 |
--------- |
|
5346 |
|
|
5347 |
- Readd ``root_policy`` attribute on Router object (as a property |
|
5348 |
which returns the IRootFactory utility). It was inadvertently |
|
5349 |
removed in 0.6.2. Code in the wild depended upon its presence |
|
5350 |
(esp. scripts and "debug" helpers). |
|
5351 |
|
|
5352 |
Features |
|
5353 |
-------- |
|
5354 |
|
|
5355 |
- URL-dispatch has been overhauled: it is no longer necessary to |
|
5356 |
manually create a RoutesMapper in your application's entry point |
|
5357 |
callable in order to use URL-dispatch (aka `Routes |
|
5358 |
<http://routes.groovie.org>`_). A new ``route`` directive has been |
|
5359 |
added to the available list of ZCML directives. Each ``route`` |
|
5360 |
directive inserted into your application's ``configure.zcml`` |
|
5361 |
establishes a Routes mapper connection. If any ``route`` |
|
5362 |
declarations are made via ZCML within a particular application, the |
|
5363 |
``get_root`` callable passed in to ``repoze.bfg.router.make_app`` |
|
5364 |
will automatically be wrapped in the equivalent of a RoutesMapper. |
|
5365 |
Additionally, the new ``route`` directive allows the specification |
|
5366 |
of a ``context_interfaces`` attribute for a route, this will be used |
|
5367 |
to tag the manufactured routes context with specific interfaces when |
|
5368 |
a route specifying a ``context_interfaces`` attribute is matched. |
|
5369 |
|
|
5370 |
- A new interface ``repoze.bfg.interfaces.IContextNotFound`` was |
|
5371 |
added. This interface is attached to a "dummy" context generated |
|
5372 |
when Routes cannot find a match and there is no "fallback" get_root |
|
5373 |
callable that uses traversal. |
|
5374 |
|
|
5375 |
- The ``bfg_starter`` and ``bfg_zodb`` "paster create" templates now |
|
5376 |
contain images and CSS which are displayed when the default page is |
|
5377 |
displayed after initial project generation. |
|
5378 |
|
|
5379 |
- Allow the ``repoze.bfg.view.static`` helper to be passed a relative |
|
5380 |
``root_path`` name; it will be considered relative to the file in |
|
5381 |
which it was called. |
|
5382 |
|
|
5383 |
- The functionality of ``repoze.bfg.convention`` has been merged into |
|
5384 |
the core. Applications which make use of ``repoze.bfg.convention`` |
|
5385 |
will continue to work indefinitely, but it is recommended that apps |
|
5386 |
stop depending upon it. To do so, substitute imports of |
|
5387 |
``repoze.bfg.convention.bfg_view`` with imports of |
|
5388 |
``repoze.bfg.view.bfg_view``, and change the stanza in ZCML from |
|
5389 |
``<convention package=".">`` to ``<scan package=".">``. As a result |
|
5390 |
of the merge, bfg has grown a new dependency: ``martian``. |
|
5391 |
|
|
5392 |
- View functions which use the pushpage decorator are now pickleable |
|
5393 |
(meaning their use won't prevent a ``configure.zcml.cache`` file |
|
5394 |
from being written to disk). |
|
5395 |
|
|
5396 |
- Instead of invariably using ``webob.Request`` as the "request |
|
5397 |
factory" (e.g. in the ``Router`` class) and ``webob.Response`` and |
|
5398 |
the "response factory" (e.g. in ``render_template_to_response``), |
|
5399 |
allow both to be overridden via a ZCML utility hook. See the "Using |
|
5400 |
ZCML Hooks" chapter of the documentation for more information. |
|
5401 |
|
|
5402 |
Deprecations |
|
5403 |
------------ |
|
5404 |
|
|
5405 |
- The class ``repoze.bfg.urldispatch.RoutesContext`` has been renamed |
|
5406 |
to ``repoze.bfg.urldispatch.DefaultRoutesContext``. The class |
|
5407 |
should be imported by the new name as necessary (although in reality |
|
5408 |
it probably shouldn't be imported from anywhere except internally |
|
5409 |
within BFG, as it's not part of the API). |
|
5410 |
|
|
5411 |
Implementation Changes |
|
5412 |
---------------------- |
|
5413 |
|
|
5414 |
- The ``repoze.bfg.wsgi.wsgiapp`` decorator now uses |
|
5415 |
``webob.Request.get_response`` to do its work rather than relying on |
|
5416 |
homegrown WSGI code. |
|
5417 |
|
|
5418 |
- The ``repoze.bfg.view.static`` helper now uses |
|
5419 |
``webob.Request.get_response`` to do its work rather than relying on |
|
5420 |
homegrown WSGI code. |
|
5421 |
|
|
5422 |
- The ``repoze.bfg.urldispatch.RoutesModelTraverser`` class has been |
|
5423 |
moved to ``repoze.bfg.traversal.RoutesModelTraverser``. |
|
5424 |
|
|
5425 |
- The ``repoze.bfg.registry.makeRegistry`` function was renamed to |
|
5426 |
``repoze.bfg.registry.populateRegistry`` and now accepts a |
|
5427 |
``registry`` argument (which should be an instance of |
|
5428 |
``zope.component.registry.Components``). |
|
5429 |
|
|
5430 |
Documentation Additions |
|
5431 |
----------------------- |
|
5432 |
|
|
5433 |
- Updated narrative urldispatch chapter with changes required by |
|
5434 |
``<route..>`` ZCML directive. |
|
5435 |
|
|
5436 |
- Add a section on "Using BFG Security With URL Dispatch" into the |
|
5437 |
urldispatch chapter of the documentation. |
|
5438 |
|
|
5439 |
- Better documentation of security policy implementations that ship |
|
5440 |
with repoze.bfg. |
|
5441 |
|
|
5442 |
- Added a "Using ZPT Macros in repoze.bfg" section to the narrative |
|
5443 |
templating chapter. |
|
5444 |
|
|
5445 |
0.6.2 (2009-01-13) |
|
5446 |
================== |
|
5447 |
|
|
5448 |
Features |
|
5449 |
-------- |
|
5450 |
|
|
5451 |
- Tests can be run with coverage output if you've got ``nose`` |
|
5452 |
installed in the interpreter which you use to run tests. Using an |
|
5453 |
interpreter with ``nose`` installed, do ``python setup.py |
|
5454 |
nosetests`` within a checkout of the ``repoze.bfg`` package to see |
|
5455 |
test coverage output. |
|
5456 |
|
|
5457 |
- Added a ``post`` argument to the ``repoze.bfg.testing:DummyRequest`` |
|
5458 |
constructor. |
|
5459 |
|
|
5460 |
- Added ``__len__`` and ``__nonzero__`` to ``repoze.bfg.testing:DummyModel``. |
|
5461 |
|
|
5462 |
- The ``repoze.bfg.registry.get_options`` callable (now renamed to |
|
5463 |
``repoze.bfg.setings.get_options``) used to return only |
|
5464 |
framework-specific keys and values in the dictionary it returned. |
|
5465 |
It now returns all the keys and values in the dictionary it is |
|
5466 |
passed *plus* any framework-specific settings culled from the |
|
5467 |
environment. As a side effect, all PasteDeploy application-specific |
|
5468 |
config file settings are made available as attributes of the |
|
5469 |
``ISettings`` utility from within BFG. |
|
5470 |
|
|
5471 |
- Renamed the existing BFG paster template to ``bfg_starter``. Added |
|
5472 |
another template (``bfg_zodb``) showing default ZODB setup using |
|
5473 |
``repoze.zodbconn``. |
|
5474 |
|
|
5475 |
- Add a method named ``assert_`` to the DummyTemplateRenderer. This |
|
5476 |
method accepts keyword arguments. Each key/value pair in the |
|
5477 |
keyword arguments causes an assertion to be made that the renderer |
|
5478 |
received this key with a value equal to the asserted value. |
|
5479 |
|
|
5480 |
- Projects generated by the paster templates now use the |
|
5481 |
``DummyTemplateRenderer.assert_`` method in their view tests. |
|
5482 |
|
|
5483 |
- Make the (internal) thread local registry manager maintain a stack |
|
5484 |
of registries in order to make it possible to call one BFG |
|
5485 |
application from inside another. |
|
5486 |
|
|
5487 |
- An interface specific to the HTTP verb (GET/PUT/POST/DELETE/HEAD) is |
|
5488 |
attached to each request object on ingress. The HTTP-verb-related |
|
5489 |
interfaces are defined in ``repoze.bfg.interfaces`` and are |
|
5490 |
``IGETRequest``, ``IPOSTRequest``, ``IPUTRequest``, |
|
5491 |
``IDELETERequest`` and ``IHEADRequest``. These interfaces can be |
|
5492 |
specified as the ``request_type`` attribute of a bfg view |
|
5493 |
declaration. A view naming a specific HTTP-verb-matching interface |
|
5494 |
will be found only if the view is defined with a request_type that |
|
5495 |
matches the HTTP verb in the incoming request. The more general |
|
5496 |
``IRequest`` interface can be used as the request_type to catch all |
|
5497 |
requests (and this is indeed the default). All requests implement |
|
5498 |
``IRequest``. The HTTP-verb-matching idea was pioneered by |
|
5499 |
`repoze.bfg.restrequest |
|
5500 |
<http://pypi.python.org/pypi/repoze.bfg.restrequest/1.0.1>`_ . That |
|
5501 |
package is no longer required, but still functions fine. |
|
5502 |
|
|
5503 |
Bug Fixes |
|
5504 |
--------- |
|
5505 |
|
|
5506 |
- Fix a bug where the Paste configuration's ``unicode_path_segments`` |
|
5507 |
(and os.environ's ``BFG_UNICODE_PATH_SEGMENTS``) may have been |
|
5508 |
defaulting to false in some circumstances. It now always defaults |
|
5509 |
to true, matching the documentation and intent. |
|
5510 |
|
|
5511 |
- The ``repoze.bfg.traversal.find_model`` API did not work properly |
|
5512 |
when passed a ``path`` argument which was unicode and contained |
|
5513 |
high-order bytes when the ``unicode_path_segments`` or |
|
5514 |
``BFG_UNICODE_PATH_SEGMENTS`` configuration variables were "true". |
|
5515 |
|
|
5516 |
- A new module was added: ``repoze.bfg.settings``. This contains |
|
5517 |
deployment-settings-related code. |
|
5518 |
|
|
5519 |
Implementation Changes |
|
5520 |
---------------------- |
|
5521 |
|
|
5522 |
- The ``make_app`` callable within ``repoze.bfg.router`` now registers |
|
5523 |
the ``root_policy`` argument as a utility (unnamed, using the new |
|
5524 |
``repoze.bfg.interfaces.IRootFactory`` as a provides interface) |
|
5525 |
rather than passing it as the first argument to the |
|
5526 |
``repoze.bfg.router.Router`` class. As a result, the |
|
5527 |
``repoze.bfg.router.Router`` router class only accepts a single |
|
5528 |
argument: ``registry``. The ``repoze.bfg.router.Router`` class |
|
5529 |
retrieves the root policy via a utility lookup now. The |
|
5530 |
``repoze.bfg.router.make_app`` API also now performs some important |
|
5531 |
application registrations that were previously handled inside |
|
5532 |
``repoze.bfg.registry.makeRegistry``. |
|
5533 |
|
|
5534 |
New Modules |
|
5535 |
----------- |
|
5536 |
|
|
5537 |
- A ``repoze.bfg.settings`` module was added. It contains code |
|
5538 |
related to deployment settings. Most of the code it contains was |
|
5539 |
moved to it from the ``repoze.bfg.registry`` module. |
|
5540 |
|
|
5541 |
Behavior Changes |
|
5542 |
---------------- |
|
5543 |
|
|
5544 |
- The ``repoze.bfg.settings.Settings`` class (an instance of which is |
|
5545 |
registered as a utility providing |
|
5546 |
``repoze.bfg.interfaces.ISettings`` when any application is started) |
|
5547 |
now automatically calls ``repoze.bfg.settings.get_options`` on the |
|
5548 |
options passed to its constructor. This means that usage of |
|
5549 |
``get_options`` within an application's ``make_app`` function is no |
|
5550 |
longer required (the "raw" ``options`` dict or None may be passed). |
|
5551 |
|
|
5552 |
- Remove old cold which attempts to recover from trying to unpickle a |
|
5553 |
``z3c.pt`` template; Chameleon has been the templating engine for a |
|
5554 |
good long time now. Running repoze.bfg against a sandbox that has |
|
5555 |
pickled ``z3c.pt`` templates it will now just fail with an |
|
5556 |
unpickling error, but can be fixed by deleting the template cache |
|
5557 |
files. |
|
5558 |
|
|
5559 |
Deprecations |
|
5560 |
------------ |
|
5561 |
|
|
5562 |
- Moved the ``repoze.bfg.registry.Settings`` class. This has been |
|
5563 |
moved to ``repoze.bfg.settings.Settings``. A deprecation warning is |
|
5564 |
issued when it is imported from the older location. |
|
5565 |
|
|
5566 |
- Moved the ``repoze.bfg.registry.get_options`` function This has been |
|
5567 |
moved to ``repoze.bfg.settings.get_options``. A deprecation warning |
|
5568 |
is issued when it is imported from the older location. |
|
5569 |
|
|
5570 |
- The ``repoze.bfg.interfaces.IRootPolicy`` interface was renamed |
|
5571 |
within the interfaces package. It has been renamed to |
|
5572 |
``IRootFactory``. A deprecation warning is issued when it is |
|
5573 |
imported from the older location. |
|
5574 |
|
|
5575 |
0.6.1 (2009-01-06) |
|
5576 |
================== |
|
5577 |
|
|
5578 |
New Modules |
|
5579 |
----------- |
|
5580 |
|
|
5581 |
- A new module ``repoze.bfg.url`` has been added. It contains the |
|
5582 |
``model_url`` API (moved from ``repoze.bfg.traversal``) and an |
|
5583 |
implementation of ``urlencode`` (like Python's |
|
5584 |
``urllib.urlencode``) which can handle Unicode keys and values in |
|
5585 |
parameters to the ``query`` argument. |
|
5586 |
|
|
5587 |
Deprecations |
|
5588 |
------------ |
|
5589 |
|
|
5590 |
- The ``model_url`` function has been moved from |
|
5591 |
``repoze.bfg.traversal`` into ``repoze.bfg.url``. It can still |
|
5592 |
be imported from ``repoze.bfg.traversal`` but an import from |
|
5593 |
``repoze.bfg.traversal`` will emit a DeprecationWarning. |
|
5594 |
|
|
5595 |
Features |
|
5596 |
-------- |
|
5597 |
|
|
5598 |
- A ``static`` helper class was added to the ``repoze.bfg.views`` |
|
5599 |
module. Instances of this class are willing to act as BFG views |
|
5600 |
which return static resources using files on disk. See the |
|
5601 |
``repoze.bfg.view`` docs for more info. |
|
5602 |
|
|
5603 |
- The ``repoze.bfg.url.model_url`` API (nee' |
|
5604 |
``repoze.bfg.traversal.model_url``) now accepts and honors a |
|
5605 |
keyword argument named ``query``. The value of this argument |
|
5606 |
will be used to compose a query string, which will be attached to |
|
5607 |
the generated URL before it is returned. See the API docs (in |
|
5608 |
the docs directory or `on the web |
|
5609 |
<http://static.repoze.org/bfgdocs>`_) for more information. |
|
5610 |
|
|
5611 |
0.6 (2008-12-26) |
|
5612 |
================ |
|
5613 |
|
|
5614 |
Backwards Incompatibilities |
|
5615 |
--------------------------- |
|
5616 |
|
|
5617 |
- Rather than prepare the "stock" implementations of the ZCML directives |
|
5618 |
from the ``zope.configuration`` package for use under ``repoze.bfg``, |
|
5619 |
``repoze.bfg`` now makes available the implementations of directives |
|
5620 |
from the ``repoze.zcml`` package (see http://static.repoze.org/zcmldocs). |
|
5621 |
As a result, the ``repoze.bfg`` package now depends on the |
|
5622 |
``repoze.zcml`` package, and no longer depends directly on the |
|
5623 |
``zope.component``, ``zope.configuration``, ``zope.interface``, or |
|
5624 |
``zope.proxy`` packages. |
|
5625 |
|
|
5626 |
The primary reason for this change is to enable us to eventually reduce |
|
5627 |
the number of inappropriate ``repoze.bfg`` Zope package dependencies, |
|
5628 |
as well as to shed features of dependent package directives that don't |
|
5629 |
make sense for ``repoze.bfg``. |
|
5630 |
|
|
5631 |
Note that currently the set of requirements necessary to use bfg has not |
|
5632 |
changed. This is due to inappropriate Zope package requirements in |
|
5633 |
``chameleon.zpt``, which will hopefully be remedied soon. NOTE: in |
|
5634 |
lemonade index a 1.0b8-repozezcml0 package exists which does away with |
|
5635 |
these requirements. |
|
5636 |
|
|
5637 |
- BFG applications written prior to this release which expect the "stock" |
|
5638 |
``zope.component`` ZCML directive implementations (e.g. ``adapter``, |
|
5639 |
``subscriber``, or ``utility``) to function now must either 1) include |
|
5640 |
the ``meta.zcml`` file from ``zope.component`` manually (e.g. ``<include |
|
5641 |
package="zope.component" file="meta.zcml">``) and include the |
|
5642 |
``zope.security`` package as an ``install_requires`` dependency or 2) |
|
5643 |
change the ZCML in their applications to use the declarations from |
|
5644 |
`repoze.zcml <http://static.repoze.org/zcmldocs/>`_ instead of the stock |
|
5645 |
declarations. ``repoze.zcml`` only makes available the ``adapter``, |
|
5646 |
``subscriber`` and ``utility`` directives. |
|
5647 |
|
|
5648 |
In short, if you've got an existing BFG application, after this |
|
5649 |
update, if your application won't start due to an import error for |
|
5650 |
"zope.security", the fastest way to get it working again is to add |
|
5651 |
``zope.security`` to the "install_requires" of your BFG |
|
5652 |
application's ``setup.py``, then add the following ZCML anywhere |
|
5653 |
in your application's ``configure.zcml``:: |
|
5654 |
|
|
5655 |
<include package="zope.component" file="meta.zcml"> |
|
5656 |
|
|
5657 |
Then re-``setup.py develop`` or reinstall your application. |
|
5658 |
|
|
5659 |
- The ``http://namespaces.repoze.org/bfg`` XML namespace is now the default |
|
5660 |
XML namespace in ZCML for paster-generated applications. The docs have |
|
5661 |
been updated to reflect this. |
|
5662 |
|
|
5663 |
- The copies of BFG's ``meta.zcml`` and ``configure.zcml`` were removed |
|
5664 |
from the root of the ``repoze.bfg`` package. In 0.3.6, a new package |
|
5665 |
named ``repoze.bfg.includes`` was added, which contains the "correct" |
|
5666 |
copies of these ZCML files; the ones that were removed were for backwards |
|
5667 |
compatibility purposes. |
|
5668 |
|
|
5669 |
- The BFG ``view`` ZCML directive no longer calls |
|
5670 |
``zope.component.interface.provideInterface`` for the ``for`` interface. |
|
5671 |
We don't support ``provideInterface`` in BFG because it mutates the |
|
5672 |
global registry. |
|
5673 |
|
|
5674 |
Other |
|
5675 |
----- |
|
5676 |
|
|
5677 |
- The minimum requirement for ``chameleon.core`` is now 1.0b13. The |
|
5678 |
minimum requirement for ``chameleon.zpt`` is now 1.0b8. The minimum |
|
5679 |
requirement for ``chameleon.genshi`` is now 1.0b2. |
|
5680 |
|
|
5681 |
- Updated paster template "ez_setup.py" to one that requires setuptools |
|
5682 |
0.6c9. |
|
5683 |
|
|
5684 |
- Turn ``view_execution_permitted`` from the ``repoze.bfg.view`` module |
|
5685 |
into a documented API. |
|
5686 |
|
|
5687 |
- Doc cleanups. |
|
5688 |
|
|
5689 |
- Documented how to create a view capable of serving static resources. |
|
5690 |
|
|
5691 |
0.5.6 (2008-12-18) |
|
5692 |
================== |
|
5693 |
|
|
5694 |
- Speed up ``traversal.model_url`` execution by using a custom url quoting |
|
5695 |
function instead of Python's ``urllib.quote``, by caching URL path |
|
5696 |
segment quoting and encoding results, by disusing Python's |
|
5697 |
``urlparse.urljoin`` in favor of a simple string concatenation, and by |
|
5698 |
using ``ob.__class__ is unicode`` rather than ``isinstance(ob, unicode)`` |
|
5699 |
in one strategic place. |
|
5700 |
|
|
5701 |
0.5.5 (2008-12-17) |
|
5702 |
================== |
|
5703 |
|
|
5704 |
Backwards Incompatibilities |
|
5705 |
--------------------------- |
|
5706 |
|
|
5707 |
- In the past, during traversal, the ModelGraphTraverser (the default |
|
5708 |
traverser) always passed each URL path segment to any ``__getitem__`` |
|
5709 |
method of a model object as a byte string (a ``str`` object). Now, by |
|
5710 |
default the ModelGraphTraverser attempts to decode the path segment to |
|
5711 |
Unicode (a ``unicode`` object) using the UTF-8 encoding before passing it |
|
5712 |
to the ``__getitem__`` method of a model object. This makes it possible |
|
5713 |
for model objects to be dumber in ``__getitem__`` when trying to resolve |
|
5714 |
a subobject, as model objects themselves no longer need to try to divine |
|
5715 |
whether or not to try to decode the path segment passed by the |
|
5716 |
traverser. |
|
5717 |
|
|
5718 |
Note that since 0.5.4, URLs generated by repoze.bfg's ``model_url`` API |
|
5719 |
will contain UTF-8 encoded path segments as necessary, so any URL |
|
5720 |
generated by BFG itself will be decodeable by the traverser. If another |
|
5721 |
application generates URLs to a BFG application, to be resolved |
|
5722 |
successully, it should generate the URL with UTF-8 encoded path segments |
|
5723 |
to be successfully resolved. The decoder is not at all magical: if a |
|
5724 |
non-UTF-8-decodeable path segment (e.g. one encoded using UTF-16 or some |
|
5725 |
other insanity) is passed in the URL, BFG will raise a ``TypeError`` with |
|
5726 |
a message indicating it could not decode the path segment. |
|
5727 |
|
|
5728 |
To turn on the older behavior, where path segments were not decoded to |
|
5729 |
Unicode before being passed to model object ``__getitem__`` by the |
|
5730 |
traverser, and were passed as a raw byte string, set the |
|
5731 |
``unicode_path_segments`` configuration setting to a false value in your |
|
5732 |
BFG application's section of the paste .ini file, for example:: |
|
5733 |
|
|
5734 |
unicode_path_segments = False |
|
5735 |
|
|
5736 |
Or start the application using the ``BFG_UNICODE_PATH_SEGMENT`` envvar |
|
5737 |
set to a false value:: |
|
5738 |
|
|
5739 |
BFG_UNICODE_PATH_SEGMENTS=0 |
|
5740 |
|
|
5741 |
0.5.4 (2008-12-13) |
|
5742 |
================== |
|
5743 |
|
|
5744 |
Backwards Incompatibilities |
|
5745 |
--------------------------- |
|
5746 |
|
|
5747 |
- URL-quote "extra" element names passed in as ``**elements`` to the |
|
5748 |
``traversal.model_url`` API. If any of these names is a Unicode string, |
|
5749 |
encode it to UTF-8 before URL-quoting. This is a slight backwards |
|
5750 |
incompatibility that will impact you if you were already UTF-8 encoding |
|
5751 |
or URL-quoting the values you passed in as ``elements`` to this API. |
|
5752 |
|
|
5753 |
Bugfixes |
|
5754 |
-------- |
|
5755 |
|
|
5756 |
- UTF-8 encode each segment in the model path used to generate a URL before |
|
5757 |
url-quoting it within the ``traversal.model_url`` API. This is a bugfix, |
|
5758 |
as Unicode cannot always be successfully URL-quoted. |
|
5759 |
|
|
5760 |
Features |
|
5761 |
-------- |
|
5762 |
|
|
5763 |
- Make it possible to run unit tests using a buildout-generated Python |
|
5764 |
"interpreter". |
|
5765 |
|
|
5766 |
- Add ``request.root`` to ``router.Router`` in order to have easy access to |
|
5767 |
the application root. |
|
5768 |
|
|
5769 |
0.5.3 (2008-12-07) |
|
5770 |
================== |
|
5771 |
|
|
5772 |
- Remove the ``ITestingTemplateRenderer`` interface. When |
|
5773 |
``testing.registerDummyRenderer`` is used, it instead registers a dummy |
|
5774 |
implementation using ``ITemplateRenderer`` interface, which is checked |
|
5775 |
for when the built-in templating facilities do rendering. This change |
|
5776 |
also allows developers to make explcit named utility registrations in |
|
5777 |
the ZCML registry against ``ITemplateRenderer``; these will be found |
|
5778 |
before any on-disk template is looked up. |
|
5779 |
|
|
5780 |
0.5.2 (2008-12-05) |
|
5781 |
================== |
|
5782 |
|
|
5783 |
- The component registration handler for views (functions or class |
|
5784 |
instances) now observes component adaptation annotations (see |
|
5785 |
``zope.component.adaptedBy``) and uses them before the fallback values |
|
5786 |
for ``for_`` and ``request_type``. This change does not affect existing |
|
5787 |
code insomuch as the code does not rely on these defaults when an |
|
5788 |
annotation is set on the view (unlikely). This means that for a |
|
5789 |
new-style class you can do ``zope.component.adapts(ISomeContext, |
|
5790 |
ISomeRequest)`` at class scope or at module scope as a decorator to a |
|
5791 |
bfg view function you can do ``@zope.component.adapter(ISomeContext, |
|
5792 |
ISomeRequest)``. This differs from r.bfg.convention inasmuch as you |
|
5793 |
still need to put something in ZCML for the registrations to get done; |
|
5794 |
it's only the defaults that will change if these declarations exist. |
|
5795 |
|
|
5796 |
- Strip all slashes from end and beginning of path in clean_path within |
|
5797 |
traversal machinery. |
|
5798 |
|
|
5799 |
0.5.1 (2008-11-25) |
|
5800 |
================== |
|
5801 |
|
|
5802 |
- Add ``keys``, ``items``, and ``values`` methods to |
|
5803 |
``testing.DummyModel``. |
|
5804 |
|
|
5805 |
- Add __delitem__ method to ``testing.DummyModel``. |
|
5806 |
|
|
5807 |
0.5.0 (2008-11-18) |
|
5808 |
================== |
|
5809 |
|
|
5810 |
- Fix ModelGraphTraverser; don't try to change the ``__name__`` or |
|
5811 |
``__parent__`` of an object that claims it implements ILocation during |
|
5812 |
traversal even if the ``__name__`` or ``__parent__`` of the object |
|
5813 |
traversed does not match the name used in the traversal step or the or |
|
5814 |
the traversal parent . Rationale: it was insane to do so. This bug was |
|
5815 |
only found due to a misconfiguration in an application that mistakenly |
|
5816 |
had intermediate persistent non-ILocation objects; traversal was causing |
|
5817 |
a persistent write on every request under this setup. |
|
5818 |
|
|
5819 |
- ``repoze.bfg.location.locate`` now unconditionally sets ``__name__`` and |
|
5820 |
``__parent__`` on objects which provide ILocation (it previously only set |
|
5821 |
them conditionally if they didn't match attributes already present on the |
|
5822 |
object via equality). |
|
5823 |
|
|
5824 |
0.4.9 (2008-11-17) |
|
5825 |
================== |
|
5826 |
|
|
5827 |
- Add chameleon text template API (chameleon ${name} renderings where the |
|
5828 |
template does not need to be wrapped in any containing XML). |
|
5829 |
|
|
5830 |
- Change docs to explain install in terms of a virtualenv |
|
5831 |
(unconditionally). |
|
5832 |
|
|
5833 |
- Make pushpage decorator compatible with repoze.bfg.convention's |
|
5834 |
``bfg_view`` decorator when they're stacked. |
|
5835 |
|
|
5836 |
- Add content_length attribute to testing.DummyRequest. |
|
5837 |
|
|
5838 |
- Change paster template ``tests.py`` to include a true unit test. Retain |
|
5839 |
old test as an integration test. Update documentation. |
|
5840 |
|
|
5841 |
- Document view registrations against classes and ``repoze.bfg.convention`` |
|
5842 |
in context. |
|
5843 |
|
|
5844 |
- Change the default paster template to register its single view against a |
|
5845 |
class rather than an interface. |
|
5846 |
|
|
5847 |
- Document adding a request type interface to the request via a subscriber |
|
5848 |
function in the events narrative documentation. |
|
5849 |
|
|
5850 |
0.4.8 (2008-11-12) |
|
5851 |
================== |
|
5852 |
|
|
5853 |
Backwards Incompatibilities |
|
5854 |
--------------------------- |
|
5855 |
|
|
5856 |
- ``repoze.bfg.traversal.model_url`` now always appends a slash to all |
|
5857 |
generated URLs unless further elements are passed in as the third and |
|
5858 |
following arguments. Rationale: views often use ``model_url`` without |
|
5859 |
the third-and-following arguments in order to generate a URL for a model |
|
5860 |
in order to point at the default view of a model. The URL that points to |
|
5861 |
the default view of the *root* model is technically ``http://mysite/`` as |
|
5862 |
opposed to ``http://mysite`` (browsers happen to ask for '/' implicitly |
|
5863 |
in the GET request). Because URLs are never automatically generated for |
|
5864 |
anything *except* models by ``model_url``, and because the root model is |
|
5865 |
not really special, we continue this pattern. The impact of this change |
|
5866 |
is minimal (at most you will have too many slashes in your URL, which BFG |
|
5867 |
deals with gracefully anyway). |
|
5868 |
|
|
5869 |
0.4.7 (2008-11-11) |
|
5870 |
================== |
|
5871 |
|
|
5872 |
Features |
|
5873 |
-------- |
|
5874 |
|
|
5875 |
- Allow ``testing.registerEventListener`` to be used with Zope 3 style |
|
5876 |
"object events" (subscribers accept more than a single event argument). |
|
5877 |
We extend the list with the arguments, rather than append. |
|
5878 |
|
|
5879 |
0.4.6 (2008-11-10) |
|
5880 |
================== |
|
5881 |
|
|
5882 |
Bug Fixes |
|
5883 |
--------- |
|
5884 |
|
|
5885 |
- The ``model_path`` and ``model_url`` traversal APIs returned the wrong |
|
5886 |
value for the root object (e.g. ``model_path`` returned ``''`` for the |
|
5887 |
root object, while it should have been returning ``'/'``). |
|
5888 |
|
|
5889 |
0.4.5 (2008-11-09) |
|
5890 |
================== |
|
5891 |
|
|
5892 |
Features |
|
5893 |
-------- |
|
5894 |
|
|
5895 |
- Added a ``clone`` method and a ``__contains__`` method to the DummyModel |
|
5896 |
testing object. |
|
5897 |
|
|
5898 |
- Allow DummyModel objects to receive extra keyword arguments, which will |
|
5899 |
be attached as attributes. |
|
5900 |
|
|
5901 |
- The DummyTemplateRenderer now returns ``self`` as its implementation. |
|
5902 |
|
|
5903 |
0.4.4 (2008-11-08) |
|
5904 |
================== |
|
5905 |
|
|
5906 |
Features |
|
5907 |
-------- |
|
5908 |
|
|
5909 |
- Added a ``repoze.bfg.testing`` module to attempt to make it slightly |
|
5910 |
easier to write unittest-based automated tests of BFG applications. |
|
5911 |
Information about this module is in the documentation. |
|
5912 |
|
|
5913 |
- The default template renderer now supports testing better by looking for |
|
5914 |
``ITestingTemplateRenderer`` using a relative pathname. This is exposed |
|
5915 |
indirectly through the API named ``registerTemplateRenderer`` in |
|
5916 |
``repoze.bfg.testing``. |
|
5917 |
|
|
5918 |
Deprecations |
|
5919 |
------------ |
|
5920 |
|
|
5921 |
- The names ``repoze.bfg.interfaces.ITemplate`` , |
|
5922 |
``repoze.bfg.interfaces.ITemplateFactory`` and |
|
5923 |
``repoze.bfg.interfaces.INodeTemplate`` have been deprecated. These |
|
5924 |
should now be imported as ``repoze.bfg.interfaces.ITemplateRenderer`` and |
|
5925 |
``repoze.bfg.interfaces.ITemplateRendererFactory``, and |
|
5926 |
``INodeTemplateRenderer`` respectively. |
|
5927 |
|
|
5928 |
- The name ``repoze.bfg.chameleon_zpt.ZPTTemplateFactory`` is deprecated. |
|
5929 |
Use ``repoze.bfg.chameleon_zpt.ZPTTemplateRenderer``. |
|
5930 |
|
|
5931 |
- The name ``repoze.bfg.chameleon_genshi.GenshiTemplateFactory`` is |
|
5932 |
deprecated. Use ``repoze.bfg.chameleon_genshi.GenshiTemplateRenderer``. |
|
5933 |
|
|
5934 |
- The name ``repoze.bfg.xslt.XSLTemplateFactory`` is deprecated. Use |
|
5935 |
``repoze.bfg.xslt.XSLTemplateRenderer``. |
|
5936 |
|
|
5937 |
0.4.3 (2008-11-02) |
|
5938 |
================== |
|
5939 |
|
|
5940 |
Bug Fixes |
|
5941 |
--------- |
|
5942 |
|
|
5943 |
- Not passing the result of "get_options" as the second argument of |
|
5944 |
make_app could cause attribute errors when attempting to look up settings |
|
5945 |
against the ISettings object (internal). Fixed by giving the Settings |
|
5946 |
objects defaults for ``debug_authorization`` and ``debug_notfound``. |
|
5947 |
|
|
5948 |
- Return an instance of ``Allowed`` (rather than ``True``) from |
|
5949 |
``has_permission`` when no security policy is in use. |
|
5950 |
|
|
5951 |
- Fix bug where default deny in authorization check would throw a TypeError |
|
5952 |
(use ``ACLDenied`` instead of ``Denied``). |
|
5953 |
|
|
5954 |
0.4.2 (2008-11-02) |
|
5955 |
================== |
|
5956 |
|
|
5957 |
Features |
|
5958 |
-------- |
|
5959 |
|
|
5960 |
- Expose a single ILogger named "repoze.bfg.debug" as a utility; this |
|
5961 |
logger is registered unconditionally and is used by the authorization |
|
5962 |
debug machinery. Applications may also make use of it as necessary |
|
5963 |
rather than inventing their own logger, for convenience. |
|
5964 |
|
|
5965 |
- The ``BFG_DEBUG_AUTHORIZATION`` envvar and the ``debug_authorization`` |
|
5966 |
config file value now only imply debugging of view-invoked security |
|
5967 |
checks. Previously, information was printed for every call to |
|
5968 |
``has_permission`` as well, which made output confusing. To debug |
|
5969 |
``has_permission`` checks and other manual permission checks, use the |
|
5970 |
debugger and print statements in your own code. |
|
5971 |
|
|
5972 |
- Authorization debugging info is now only present in the HTTP response |
|
5973 |
body oif ``debug_authorization`` is true. |
|
5974 |
|
|
5975 |
- The format of authorization debug messages was improved. |
|
5976 |
|
|
5977 |
- A new ``BFG_DEBUG_NOTFOUND`` envvar was added and a symmetric |
|
5978 |
``debug_notfound`` config file value was added. When either is true, and |
|
5979 |
a NotFound response is returned by the BFG router (because a view could |
|
5980 |
not be found), debugging information is printed to stderr. When this |
|
5981 |
value is set true, the body of HTTPNotFound responses will also contain |
|
5982 |
the same debugging information. |
|
5983 |
|
|
5984 |
- ``Allowed`` and ``Denied`` responses from the security machinery are now |
|
5985 |
specialized into two types: ACL types, and non-ACL types. The |
|
5986 |
ACL-related responses are instances of ``repoze.bfg.security.ACLAllowed`` |
|
5987 |
and ``repoze.bfg.security.ACLDenied``. The non-ACL-related responses are |
|
5988 |
``repoze.bfg.security.Allowed`` and ``repoze.bfg.security.Denied``. The |
|
5989 |
allowed-type responses continue to evaluate equal to things that |
|
5990 |
themselves evaluate equal to the ``True`` boolean, while the denied-type |
|
5991 |
responses continue to evaluate equal to things that themselves evaluate |
|
5992 |
equal to the ``False`` boolean. The only difference between the two |
|
5993 |
types is the information attached to them for debugging purposes. |
|
5994 |
|
|
5995 |
- Added a new ``BFG_DEBUG_ALL`` envvar and a symmetric ``debug_all`` config |
|
5996 |
file value. When either is true, all other debug-related flags are set |
|
5997 |
true unconditionally (e.g. ``debug_notfound`` and |
|
5998 |
``debug_authorization``). |
|
5999 |
|
|
6000 |
Documentation |
|
6001 |
------------- |
|
6002 |
|
|
6003 |
- Added info about debug flag changes. |
|
6004 |
|
|
6005 |
- Added a section to the security chapter named "Debugging Imperative |
|
6006 |
Authorization Failures" (for e.g. ``has_permssion``). |
|
6007 |
|
|
6008 |
Bug Fixes |
|
6009 |
--------- |
|
6010 |
|
|
6011 |
- Change default paster template generator to use ``Paste#http`` server |
|
6012 |
rather than ``PasteScript#cherrpy`` server. The cherrypy server has a |
|
6013 |
security risk in it when ``REMOTE_USER`` is trusted by the downstream |
|
6014 |
application. |
|
6015 |
|
|
6016 |
0.4.1 (2008-10-28) |
|
6017 |
================== |
|
6018 |
|
|
6019 |
Bug Fixes |
|
6020 |
--------- |
|
6021 |
|
|
6022 |
- If the ``render_view_to_response`` function was called, if the view was |
|
6023 |
found and called, but it returned something that did not implement |
|
6024 |
IResponse, the error would pass by unflagged. This was noticed when I |
|
6025 |
created a view function that essentially returned None, but received a |
|
6026 |
NotFound error rather than a ValueError when the view was rendered. This |
|
6027 |
was fixed. |
|
6028 |
|
|
6029 |
0.4.0 (2008-10-03) |
|
6030 |
================== |
|
6031 |
|
|
6032 |
Docs |
|
6033 |
---- |
|
6034 |
|
|
6035 |
- An "Environment and Configuration" chapter was added to the narrative |
|
6036 |
portion of the documentation. |
|
6037 |
|
|
6038 |
Features |
|
6039 |
-------- |
|
6040 |
|
|
6041 |
- Ensure bfg doesn't generate warnings when running under Python |
|
6042 |
2.6. |
|
6043 |
|
|
6044 |
- The environment variable ``BFG_RELOAD_TEMPLATES`` is now available |
|
6045 |
(serves the same purpose as ``reload_templates`` in the config file). |
|
6046 |
|
|
6047 |
- A new configuration file option ``debug_authorization`` was added. |
|
6048 |
This turns on printing of security authorization debug statements |
|
6049 |
to ``sys.stderr``. The ``BFG_DEBUG_AUTHORIZATION`` environment |
|
6050 |
variable was also added; this performs the same duty. |
|
6051 |
|
|
6052 |
Bug Fixes |
|
6053 |
--------- |
|
6054 |
|
|
6055 |
- The environment variable ``BFG_SECURITY_DEBUG`` did not always work. |
|
6056 |
It has been renamed to ``BFG_DEBUG_AUTHORIZATION`` and fixed. |
|
6057 |
|
|
6058 |
Deprecations |
|
6059 |
------------ |
|
6060 |
|
|
6061 |
- A deprecation warning is now issued when old API names from the |
|
6062 |
``repoze.bfg.templates`` module are imported. |
|
6063 |
|
|
6064 |
Backwards incompatibilities |
|
6065 |
--------------------------- |
|
6066 |
|
|
6067 |
- The ``BFG_SECURITY_DEBUG`` environment variable was renamed to |
|
6068 |
``BFG_DEBUG_AUTHORIZATION``. |
|
6069 |
|
|
6070 |
0.3.9 (2008-08-27) |
|
6071 |
================== |
|
6072 |
|
|
6073 |
Features |
|
6074 |
-------- |
|
6075 |
|
|
6076 |
- A ``repoze.bfg.location`` API module was added. |
|
6077 |
|
|
6078 |
Backwards incompatibilities |
|
6079 |
--------------------------- |
|
6080 |
|
|
6081 |
- Applications must now use the ``repoze.bfg.interfaces.ILocation`` |
|
6082 |
interface rather than ``zope.location.interfaces.ILocation`` to |
|
6083 |
represent that a model object is "location-aware". We've removed |
|
6084 |
a dependency on ``zope.location`` for cleanliness purposes: as |
|
6085 |
new versions of zope libraries are released which have improved |
|
6086 |
dependency information, getting rid of our dependence on |
|
6087 |
``zope.location`` will prevent a newly installed repoze.bfg |
|
6088 |
application from requiring the ``zope.security``, egg, which not |
|
6089 |
truly used at all in a "stock" repoze.bfg setup. These |
|
6090 |
dependencies are still required by the stack at this time; this |
|
6091 |
is purely a futureproofing move. |
|
6092 |
|
|
6093 |
The security and model documentation for previous versions of |
|
6094 |
``repoze.bfg`` recommended using the |
|
6095 |
``zope.location.interfaces.ILocation`` interface to represent |
|
6096 |
that a model object is "location-aware". This documentation has |
|
6097 |
been changed to reflect that this interface should now be |
|
6098 |
imported from ``repoze.bfg.interfaces.ILocation`` instead. |
|
6099 |
|
|
6100 |
0.3.8 (2008-08-26) |
|
6101 |
================== |
|
6102 |
|
|
6103 |
Docs |
|
6104 |
---- |
|
6105 |
|
|
6106 |
- Documented URL dispatch better in narrative form. |
|
6107 |
|
|
6108 |
Bug fixes |
|
6109 |
--------- |
|
6110 |
|
|
6111 |
- Routes URL dispatch did not have access to the WSGI environment, |
|
6112 |
so conditions such as method=GET did not work. |
|
6113 |
|
|
6114 |
Features |
|
6115 |
-------- |
|
6116 |
|
|
6117 |
- Add ``principals_allowed_by_permission`` API to security module. |
|
6118 |
|
|
6119 |
- Replace ``z3c.pt`` support with support for ``chameleon.zpt``. |
|
6120 |
Chameleon is the new name for the package that used to be named |
|
6121 |
``z3c.pt``. NOTE: If you update a ``repoze.bfg`` SVN checkout |
|
6122 |
that you're using for development, you will need to run "setup.py |
|
6123 |
install" or "setup.py develop" again in order to obtain the |
|
6124 |
proper Chameleon packages. ``z3c.pt`` is no longer supported by |
|
6125 |
``repoze.bfg``. All API functions that used to render ``z3c.pt`` |
|
6126 |
templates will work fine with the new packages, and your |
|
6127 |
templates should render almost identically. |
|
6128 |
|
|
6129 |
- Add a ``repoze.bfg.chameleon_zpt`` module. This module provides |
|
6130 |
Chameleon ZPT support. |
|
6131 |
|
|
6132 |
- Add a ``repoze.bfg.xslt`` module. This module provides XSLT |
|
6133 |
support. |
|
6134 |
|
|
6135 |
- Add a ``repoze.bfg.chameleon_genshi`` module. This provides |
|
6136 |
direct Genshi support, which did not exist previously. |
|
6137 |
|
|
6138 |
Deprecations |
|
6139 |
------------ |
|
6140 |
|
|
6141 |
- Importing API functions directly from ``repoze.bfg.template`` is |
|
6142 |
now deprecated. The ``get_template``, ``render_template``, |
|
6143 |
``render_template_to_response`` functions should now be imported |
|
6144 |
from ``repoze.chameleon_zpt``. The ``render_transform``, and |
|
6145 |
``render_transform_to_response`` functions should now be imported |
|
6146 |
from ``repoze.bfg.xslt``. The ``repoze.bfg.template`` module |
|
6147 |
will remain around "forever" to support backwards compatibility. |
|
6148 |
|
|
6149 |
0.3.7 (2008-09-09) |
|
6150 |
================== |
|
6151 |
|
|
6152 |
Features |
|
6153 |
-------- |
|
6154 |
|
|
6155 |
- Add compatibility with z3c.pt 1.0a7+ (z3c.pt became a namespace package). |
|
6156 |
|
|
6157 |
Bug fixes |
|
6158 |
--------- |
|
6159 |
|
|
6160 |
- ``repoze.bfg.traversal.find_model`` function did not function properly. |
|
6161 |
|
|
6162 |
0.3.6 (2008-09-04) |
|
6163 |
================== |
|
6164 |
|
|
6165 |
Features |
|
6166 |
-------- |
|
6167 |
|
|
6168 |
- Add startup process docs. |
|
6169 |
|
|
6170 |
- Allow configuration cache to be bypassed by actions which include special |
|
6171 |
"uncacheable" discriminators (for actions that have variable results). |
|
6172 |
|
|
6173 |
Bug Fixes |
|
6174 |
--------- |
|
6175 |
|
|
6176 |
- Move core repoze.bfg ZCML into a ``repoze.bfg.includes`` package so we |
|
6177 |
can use repoze.bfg better as a namespace package. Adjust the code |
|
6178 |
generator to use it. We've left around the ``configure.zcml`` in the |
|
6179 |
repoze.bfg package directly so as not to break older apps. |
|
6180 |
|
|
6181 |
- When a zcml application registry cache was unpickled, and it contained a |
|
6182 |
reference to an object that no longer existed (such as a view), bfg would |
|
6183 |
not start properly. |
|
6184 |
|
|
6185 |
0.3.5 (2008-09-01) |
|
6186 |
================== |
|
6187 |
|
|
6188 |
Features |
|
6189 |
-------- |
|
6190 |
|
|
6191 |
- Event notification is issued after application is created and configured |
|
6192 |
(``IWSGIApplicationCreatedEvent``). |
|
6193 |
|
|
6194 |
- New API module: ``repoze.bfg.view``. This module contains the functions |
|
6195 |
named ``render_view_to_response``, ``render_view_to_iterable``, |
|
6196 |
``render_view`` and ``is_response``, which are documented in the API |
|
6197 |
docs. These features aid programmatic (non-server-driven) view |
|
6198 |
execution. |
|
6199 |
|
|
6200 |
0.3.4 (2008-08-28) |
|
6201 |
================== |
|
6202 |
|
|
6203 |
Backwards incompatibilities |
|
6204 |
--------------------------- |
|
6205 |
|
|
6206 |
- Make ``repoze.bfg`` a namespace package so we can allow folks to create |
|
6207 |
subpackages (e.g. ``repoze.bfg.otherthing``) within separate eggs. This |
|
6208 |
is a backwards incompatible change which makes it impossible to import |
|
6209 |
"make_app" and "get_options" from the ``repoze.bfg`` module directly. |
|
6210 |
This change will break all existing apps generated by the paster code |
|
6211 |
generator. Instead, you need to import these functions as |
|
6212 |
``repoze.bfg.router:make_app`` and ``repoze.bfg.registry:get_options``, |
|
6213 |
respectively. Sorry folks, it has to be done now or never, and |
|
6214 |
definitely better now. |
|
6215 |
|
|
6216 |
Features |
|
6217 |
-------- |
|
6218 |
|
|
6219 |
- Add ``model_path`` API function to traversal module. |
|
6220 |
|
|
6221 |
Bugfixes |
|
6222 |
|
|
6223 |
- Normalize path returned by repoze.bfg.caller_path. |
|
6224 |
|
|
6225 |
0.3.3 (2008-08-23) |
|
6226 |
================== |
|
6227 |
|
|
6228 |
- Fix generated test.py module to use project name rather than package |
|
6229 |
name. |
|
6230 |
|
|
6231 |
0.3.2 (2008-08-23) |
|
6232 |
================== |
|
6233 |
|
|
6234 |
- Remove ``sampleapp`` sample application from bfg package itself. |
|
6235 |
|
|
6236 |
- Remove dependency on FormEncode (only needed by sampleapp). |
|
6237 |
|
|
6238 |
- Fix paster template generation so that case-sensitivity is preserved for |
|
6239 |
project vs. package name. |
|
6240 |
|
|
6241 |
- Depend on ``z3c.pt`` version 1.0a1 (which requires the ``[lxml]`` extra |
|
6242 |
currently). |
|
6243 |
|
|
6244 |
- Read and write a pickled ZCML actions list, stored as |
|
6245 |
``configure.zcml.cache`` next to the applications's "normal" |
|
6246 |
configuration file. A given bfg app will usually start faster if it's |
|
6247 |
able to read the pickle data. It fails gracefully to reading the real |
|
6248 |
ZCML file if it cannot read the pickle. |
|
6249 |
|
|
6250 |
0.3.1 (2008-08-20) |
|
6251 |
================== |
|
6252 |
|
|
6253 |
- Generated application differences: ``make_app`` entry point renamed to |
|
6254 |
``app`` in order to have a different name than the bfg function of the |
|
6255 |
same name, to prevent confusion. |
|
6256 |
|
|
6257 |
- Add "options" processing to bfg's ``make_app`` to support runtime |
|
6258 |
options. A new API function named ``get_options`` was added to the |
|
6259 |
registry module. This function is typically used in an application's |
|
6260 |
``app`` entry point. The Paste config file section for the app can now |
|
6261 |
supply the ``reload_templates`` option, which, if true, will prevent the |
|
6262 |
need to restart the appserver in order for ``z3c.pt`` or XSLT template |
|
6263 |
changes to be detected. |
|
6264 |
|
|
6265 |
- Use only the module name in generated project's "test_suite" (run all |
|
6266 |
tests found in the package). |
|
6267 |
|
|
6268 |
- Default port for generated apps changed from 5432 to 6543 (Postgres |
|
6269 |
default port is 6543). |
|
6270 |
|
|
6271 |
0.3.0 (2008-08-16) |
|
6272 |
================== |
|
6273 |
|
|
6274 |
- Add ``get_template`` API to template module. |
|
6275 |
|
|
6276 |
0.2.9 (2008-08-11) |
|
6277 |
================== |
|
6278 |
|
|
6279 |
- 0.2.8 was "brown bag" release. It didn't work at all. Symptom: |
|
6280 |
ComponentLookupError when trying to render a page. |
|
6281 |
|
|
6282 |
0.2.8 (2008-08-11) |
|
6283 |
================== |
|
6284 |
|
|
6285 |
- Add ``find_model`` and ``find_root`` traversal APIs. In the process, |
|
6286 |
make ITraverser a uni-adapter (on context) rather than a multiadapter (on |
|
6287 |
context and request). |
|
6288 |
|
|
6289 |
0.2.7 (2008-08-05) |
|
6290 |
================== |
|
6291 |
|
|
6292 |
- Add a ``request_type`` attribute to the available attributes of a |
|
6293 |
``bfg:view`` configure.zcml element. This attribute will have a value |
|
6294 |
which is a dotted Python path, pointing at an interface. If the request |
|
6295 |
object implements this interface when the view lookup is performed, the |
|
6296 |
appropriate view will be called. This is meant to allow for simple |
|
6297 |
"skinning" of sites based on request type. An event subscriber should |
|
6298 |
attach the interface to the request on ingress to support skins. |
|
6299 |
|
|
6300 |
- Remove "template only" views. These were just confusing and were never |
|
6301 |
documented. |
|
6302 |
|
|
6303 |
- Small url dispatch overhaul: the ``connect`` method of the |
|
6304 |
``urldispatch.RoutesMapper`` object now accepts a keyword parameter named |
|
6305 |
``context_factory``. If this parameter is supplied, it must be a |
|
6306 |
callable which returns an instance. This instance is used as the context |
|
6307 |
for the request when a route is matched. |
|
6308 |
|
|
6309 |
- The registration of a RoutesModelTraverser no longer needs to be |
|
6310 |
performed by the application; it's in the bfg ZCML now. |
|
6311 |
|
|
6312 |
0.2.6 (2008-07-31) |
|
6313 |
================== |
|
6314 |
|
|
6315 |
- Add event sends for INewRequest and INewResponse. See the events.rst |
|
6316 |
chapter in the documentation's ``api`` directory. |
|
6317 |
|
|
6318 |
0.2.5 (2008-07-28) |
|
6319 |
================== |
|
6320 |
|
|
6321 |
- Add ``model_url`` API. |
|
6322 |
|
|
6323 |
0.2.4 (2008-07-27) |
|
6324 |
================== |
|
6325 |
|
|
6326 |
- Added url-based dispatch. |
|
6327 |
|
|
6328 |
0.2.3 (2008-07-20) |
|
6329 |
================== |
|
6330 |
|
|
6331 |
- Add API functions for authenticated_userid and effective_principals. |
|
6332 |
|
|
6333 |
0.2.2 (2008-07-20) |
|
6334 |
================== |
|
6335 |
|
|
6336 |
- Add authenticated_userid and effective_principals API to security |
|
6337 |
policy. |
|
6338 |
|
|
6339 |
0.2.1 (2008-07-20) |
|
6340 |
================== |
|
6341 |
|
|
6342 |
- Add find_interface API. |
|
6343 |
|
|
6344 |
0.2 (2008-07-19) |
|
6345 |
================ |
|
6346 |
|
|
6347 |
- Add wsgiapp decorator. |
|
6348 |
|
|
6349 |
- The concept of "view factories" was removed in favor of always calling a |
|
6350 |
view, which is a callable that returns a response directly (as opposed to |
|
6351 |
returning a view). As a result, the ``factory`` attribute in the |
|
6352 |
bfg:view ZCML statement has been renamed to ``view``. Various interface |
|
6353 |
names were changed also. |
|
6354 |
|
|
6355 |
- ``render_template`` and ``render_transform`` no longer return a Response |
|
6356 |
object. Instead, these return strings. The old behavior can be obtained |
|
6357 |
by using ``render_template_to_response`` and |
|
6358 |
``render_transform_to_response``. |
|
6359 |
|
|
6360 |
- Added 'repoze.bfg.push:pushpage' decorator, which creates BFG views from |
|
6361 |
callables which take (context, request) and return a mapping of top-level |
|
6362 |
names. |
|
6363 |
|
|
6364 |
- Added ACL-based security. |
|
6365 |
|
|
6366 |
- Support for XSLT templates via a render_transform method |
|
6367 |
|
|
6368 |
0.1 (2008-07-08) |
|
6369 |
================ |
|
6370 |
|
|
6371 |
- Initial release. |
|
6372 |
|