commit | author | age
|
cc85e7
|
1 |
1.1a2 (2011-06-22) |
CM |
2 |
================== |
c724f0
|
3 |
|
d74d53
|
4 |
Bug Fixes |
CM |
5 |
--------- |
|
6 |
|
|
7 |
- 1.1a1 broke Akhet by not providing a backwards compatibility import shim |
|
8 |
for ``pyramid.paster.PyramidTemplate``. Now one has been added, although a |
cc85e7
|
9 |
deprecation warning is emitted when Akhet imports it. |
d74d53
|
10 |
|
6ed33e
|
11 |
- If multiple specs were provided in a single call to |
CM |
12 |
``config.add_translation_dirs``, the directories were inserted into the |
|
13 |
beginning of the directory list in the wrong order: they were inserted in |
|
14 |
the reverse of the order they were provided in the ``*specs`` list (items |
4f11dc
|
15 |
later in the list were added before ones earlier in the list). This is now |
CM |
16 |
fixed. |
6ed33e
|
17 |
|
c724f0
|
18 |
Backwards Incompatibilities |
CM |
19 |
--------------------------- |
|
20 |
|
|
21 |
- The pyramid Router attempted to set a value into the key |
|
22 |
``environ['repoze.bfg.message']`` when it caught a view-related exception |
cc85e7
|
23 |
for backwards compatibility with applications written for ``repoze.bfg`` |
CM |
24 |
during error handling. It did this by using code that looked like so:: |
c724f0
|
25 |
|
CM |
26 |
# "why" is an exception object |
|
27 |
try: |
|
28 |
msg = why[0] |
|
29 |
except: |
|
30 |
msg = '' |
|
31 |
|
|
32 |
environ['repoze.bfg.message'] = msg |
|
33 |
|
|
34 |
Use of the value ``environ['repoze.bfg.message']`` was docs-deprecated in |
|
35 |
Pyramid 1.0. Our standing policy is to not remove features after a |
|
36 |
deprecation for two full major releases, so this code was originally slated |
|
37 |
to be removed in Pyramid 1.2. However, computing the |
|
38 |
``repoze.bfg.message`` value was the source of at least one bug found in |
|
39 |
the wild (https://github.com/Pylons/pyramid/issues/199), and there isn't a |
|
40 |
foolproof way to both preserve backwards compatibility and to fix the bug. |
|
41 |
Therefore, the code which sets the value has been removed in this release. |
|
42 |
Code in exception views which relies on this value's presence in the |
|
43 |
environment should now use the ``exception`` attribute of the request |
|
44 |
(e.g. ``request.exception[0]``) to retrieve the message instead of relying |
|
45 |
on ``request.environ['repoze.bfg.message']``. |
|
46 |
|
83549e
|
47 |
1.1a1 (2011-06-20) |
CM |
48 |
================== |
959523
|
49 |
|
8027ad
|
50 |
Documentation |
JD |
51 |
------------- |
|
52 |
|
af71c2
|
53 |
- The term "template" used to refer to both "paster templates" and "rendered |
CM |
54 |
templates" (templates created by a rendering engine. i.e. Mako, Chameleon, |
|
55 |
Jinja, etc.). "Paster templates" will now be refered to as "scaffolds", |
|
56 |
whereas the name for "rendered templates" will remain as "templates." |
8027ad
|
57 |
|
88f967
|
58 |
- The ``wiki`` (ZODB+Traversal) tutorial was updated slightly. |
CM |
59 |
|
|
60 |
- The ``wiki2`` (SQLA+URL Dispatch) tutorial was updated slightly. |
|
61 |
|
d2973d
|
62 |
- Make ``pyramid.interfaces.IAuthenticationPolicy`` and |
CM |
63 |
``pyramid.interfaces.IAuthorizationPolicy`` public interfaces, and refer to |
|
64 |
them within the ``pyramid.authentication`` and ``pyramid.authorization`` |
|
65 |
API docs. |
|
66 |
|
|
67 |
- Render the function definitions for each exposed interface in |
|
68 |
``pyramid.interfaces``. |
|
69 |
|
cae85d
|
70 |
- Add missing docs reference to |
CM |
71 |
``pyramid.config.Configurator.set_view_mapper`` and refer to it within |
|
72 |
Hooks chapter section named "Using a View Mapper". |
|
73 |
|
f6799b
|
74 |
- Added section to the "Environment Variables and ``.ini`` File Settings" |
CM |
75 |
chapter in the narrative documentation section entitled "Adding a Custom |
|
76 |
Setting". |
|
77 |
|
2a1c3f
|
78 |
- Added documentation for a "multidict" (e.g. the API of ``request.POST``) as |
CM |
79 |
interface API documentation. |
|
80 |
|
e725cf
|
81 |
- Added a section to the "URL Dispatch" narrative chapter regarding the new |
CM |
82 |
"static" route feature. |
|
83 |
|
2ce652
|
84 |
- Added "What's New in Pyramid 1.1" to HTML rendering of documentation. |
CM |
85 |
|
0ca4bb
|
86 |
- Added API docs for ``pyramid.authentication.SessionAuthenticationPolicy``. |
CM |
87 |
|
f8f08b
|
88 |
- Added API docs for ``pyramid.httpexceptions.exception_response``. |
1ffb8e
|
89 |
|
CM |
90 |
- Added "HTTP Exceptions" section to Views narrative chapter including a |
f8f08b
|
91 |
description of ``pyramid.httpexceptions.exception_response``. |
1ffb8e
|
92 |
|
fcbd7b
|
93 |
Features |
CM |
94 |
-------- |
4d9260
|
95 |
|
f3e62c
|
96 |
- Add support for language fallbacks: when trying to translate for a |
WA |
97 |
specific territory (such as ``en_GB``) fall back to translations |
|
98 |
for the language (ie ``en``). This brings the translation behaviour in line |
|
99 |
with GNU gettext and fixes partially translated texts when using C |
|
100 |
extensions. |
|
101 |
|
0ca4bb
|
102 |
- New authentication policy: |
CM |
103 |
``pyramid.authentication.SessionAuthenticationPolicy``, which uses a session |
|
104 |
to store credentials. |
|
105 |
|
4d9260
|
106 |
- Accessing the ``response`` attribute of a ``pyramid.request.Request`` |
CM |
107 |
object (e.g. ``request.response`` within a view) now produces a new |
|
108 |
``pyramid.response.Response`` object. This feature is meant to be used |
|
109 |
mainly when a view configured with a renderer needs to set response |
db51c0
|
110 |
attributes: all renderers will use the Response object implied by |
CM |
111 |
``request.response`` as the response object returned to the router. |
|
112 |
|
|
113 |
``request.response`` can also be used by code in a view that does not use a |
|
114 |
renderer, however the response object that is produced by |
|
115 |
``request.response`` must be returned when a renderer is not in play (it is |
|
116 |
not a "global" response). |
fcbd7b
|
117 |
|
CM |
118 |
- Integers and longs passed as ``elements`` to ``pyramid.url.resource_url`` |
|
119 |
or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context, |
|
120 |
request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be |
|
121 |
converted implicitly to strings in the result. Previously passing integers |
|
122 |
or longs as elements would cause a TypeError. |
|
123 |
|
296ee2
|
124 |
- ``pyramid_alchemy`` paster template now uses ``query.get`` rather than |
CM |
125 |
``query.filter_by`` to take better advantage of identity map caching. |
|
126 |
|
|
127 |
- ``pyramid_alchemy`` paster template now has unit tests. |
|
128 |
|
2242e6
|
129 |
- Added ``pyramid.i18n.make_localizer`` API (broken out from |
CM |
130 |
``get_localizer`` guts). |
|
131 |
|
ba2ac1
|
132 |
- An exception raised by a NewRequest event subscriber can now be caught by |
CM |
133 |
an exception view. |
|
134 |
|
b32552
|
135 |
- It is now possible to get information about why Pyramid raised a Forbidden |
CM |
136 |
exception from within an exception view. The ``ACLDenied`` object returned |
|
137 |
by the ``permits`` method of each stock authorization policy |
|
138 |
(``pyramid.interfaces.IAuthorizationPolicy.permits``) is now attached to |
|
139 |
the Forbidden exception as its ``result`` attribute. Therefore, if you've |
|
140 |
created a Forbidden exception view, you can see the ACE, ACL, permission, |
|
141 |
and principals involved in the request as |
|
142 |
eg. ``context.result.permission``, ``context.result.acl``, etc within the |
|
143 |
logic of the Forbidden exception view. |
|
144 |
|
474df5
|
145 |
- Don't explicitly prevent the ``timeout`` from being lower than the |
CM |
146 |
``reissue_time`` when setting up an ``AuthTktAuthenticationPolicy`` |
|
147 |
(previously such a configuration would raise a ``ValueError``, now it's |
|
148 |
allowed, although typically nonsensical). Allowing the nonsensical |
|
149 |
configuration made the code more understandable and required fewer tests. |
|
150 |
|
99a32e
|
151 |
- A new paster command named ``paster pviews`` was added. This command |
CM |
152 |
prints a summary of potentially matching views for a given path. See the |
|
153 |
section entitled "Displaying Matching Views for a Given URL" in the "View |
|
154 |
Configuration" chapter of the narrative documentation for more information. |
|
155 |
|
e725cf
|
156 |
- The ``add_route`` method of the Configurator now accepts a ``static`` |
CM |
157 |
argument. If this argument is ``True``, the added route will never be |
|
158 |
considered for matching when a request is handled. Instead, it will only |
|
159 |
be useful for URL generation via ``route_url`` and ``route_path``. See the |
|
160 |
section entitled "Static Routes" in the URL Dispatch narrative chapter for |
|
161 |
more information. |
|
162 |
|
966b5c
|
163 |
- A default exception view for the context |
99edc5
|
164 |
``pyramid.interfaces.IExceptionResponse`` is now registered by default. |
CM |
165 |
This means that an instance of any exception response class imported from |
|
166 |
``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from |
|
167 |
within view code; when raised, this exception view will render the |
|
168 |
exception to a response. |
1ffb8e
|
169 |
|
f8f08b
|
170 |
- A function named ``pyramid.httpexceptions.exception_response`` is a |
CM |
171 |
shortcut that can be used to create HTTP exception response objects using |
|
172 |
an HTTP integer status code. |
1ffb8e
|
173 |
|
CM |
174 |
- The Configurator now accepts an additional keyword argument named |
966b5c
|
175 |
``exceptionresponse_view``. By default, this argument is populated with a |
CM |
176 |
default exception view function that will be used when a response is raised |
|
177 |
as an exception. When ``None`` is passed for this value, an exception view |
|
178 |
for responses will not be registered. Passing ``None`` returns the |
|
179 |
behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception |
|
180 |
will propagate to middleware and to the WSGI server). |
|
181 |
|
|
182 |
- The ``pyramid.request.Request`` class now has a ``ResponseClass`` interface |
|
183 |
which points at ``pyramid.response.Response``. |
|
184 |
|
8cbbd9
|
185 |
- The ``pyramid.response.Response`` class now has a ``RequestClass`` |
CM |
186 |
interface which points at ``pyramid.request.Request``. |
1ffb8e
|
187 |
|
d868ff
|
188 |
- It is now possible to return an arbitrary object from a Pyramid view |
CM |
189 |
callable even if a renderer is not used, as long as a suitable adapter to |
|
190 |
``pyramid.interfaces.IResponse`` is registered for the type of the returned |
1a6fc7
|
191 |
object by using the new |
CM |
192 |
``pyramid.config.Configurator.add_response_adapter`` API. See the section |
|
193 |
in the Hooks chapter of the documentation entitled "Changing How Pyramid |
|
194 |
Treats View Responses". |
df15ed
|
195 |
|
99edc5
|
196 |
- The Pyramid router will now, by default, call the ``__call__`` method of |
CM |
197 |
WebOb response objects when returning a WSGI response. This means that, |
|
198 |
among other things, the ``conditional_response`` feature of WebOb response |
|
199 |
objects will now behave properly. |
df15ed
|
200 |
|
920990
|
201 |
- New method named ``pyramid.request.Request.is_response``. This method |
CM |
202 |
should be used instead of the ``pyramid.view.is_response`` function, which |
|
203 |
has been deprecated. |
e39ddf
|
204 |
|
JG |
205 |
Bug Fixes |
|
206 |
--------- |
|
207 |
|
0fd8ea
|
208 |
- URL pattern markers used in URL dispatch are permitted to specify a custom |
CM |
209 |
regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345`` |
|
210 |
(foo==12345 in the match dictionary) but not ``/abc``. However, custom |
0a0edf
|
211 |
regexes in a pattern marker which used squiggly brackets did not work. For |
CM |
212 |
example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and |
|
213 |
``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of |
|
214 |
inner squiggly brackets is now recognized so that the prior two patterns |
|
215 |
given as examples now work. See also |
|
216 |
https://github.com/Pylons/pyramid/issues/#issue/123. |
|
217 |
|
|
218 |
- Don't send port numbers along with domain information in cookies set by |
115c71
|
219 |
AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131). |
CM |
220 |
|
|
221 |
- ``pyramid.url.route_path`` (and the shortcut |
|
222 |
``pyramid.request.Request.route_url`` method) now include the WSGI |
b596e1
|
223 |
SCRIPT_NAME at the front of the path if it is not empty (see |
CM |
224 |
https://github.com/Pylons/pyramid/issues/135). |
|
225 |
|
|
226 |
- ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the |
0b2629
|
227 |
empty string). |
CM |
228 |
|
|
229 |
- Don't quote ``:@&+$,`` symbols in ``*elements`` passed to |
|
230 |
``pyramid.url.route_url`` or ``pyramid.url.resource_url`` (see |
|
231 |
https://github.com/Pylons/pyramid/issues#issue/141). |
|
232 |
|
|
233 |
- Include SCRIPT_NAME in redirects issued by |
|
234 |
``pyramid.view.append_slash_notfound_view`` (see |
|
235 |
https://github.com/Pylons/pyramid/issues#issue/149). |
|
236 |
|
|
237 |
- Static views registered with ``config.add_static_view`` which also included |
|
238 |
a ``permission`` keyword argument would not work as expected, because |
|
239 |
``add_static_view`` also registered a route factory internally. Because a |
|
240 |
route factory was registered internally, the context checked by the Pyramid |
8af47b
|
241 |
permission machinery never had an ACL. ``add_static_view`` no longer |
CM |
242 |
registers a route with a factory, so the default root factory will be used. |
|
243 |
|
|
244 |
- ``config.add_static_view`` now passes extra keyword arguments it receives |
|
245 |
to ``config.add_route`` (calling add_static_view is mostly logically |
|
246 |
equivalent to adding a view of the type ``pyramid.static.static_view`` |
|
247 |
hooked up to a route with a subpath). This makes it possible to pass e.g., |
29a850
|
248 |
``factory=`` to ``add_static_view`` to protect a particular static view |
CM |
249 |
with a custom ACL. |
|
250 |
|
|
251 |
- ``testing.DummyRequest`` used the wrong registry (the global registry) as |
|
252 |
``self.registry`` if a dummy request was created *before* ``testing.setUp`` |
|
253 |
was executed (``testing.setUp`` pushes a local registry onto the |
|
254 |
threadlocal stack). Fixed by implementing ``registry`` as a property for |
|
255 |
DummyRequest instead of eagerly assigning an attribute. |
|
256 |
See also https://github.com/Pylons/pyramid/issues/165 |
|
257 |
|
ba0a5f
|
258 |
- When visiting a URL that represented a static view which resolved to a |
CM |
259 |
subdirectory, the ``index.html`` of that subdirectory would not be served |
|
260 |
properly. Instead, a redirect to ``/subdir`` would be issued. This has |
|
261 |
been fixed, and now visiting a subdirectory that contains an ``index.html`` |
|
262 |
within a static view returns the index.html properly. See also |
|
263 |
https://github.com/Pylons/pyramid/issues/67. |
|
264 |
|
4d9260
|
265 |
- Redirects issued by a static view did not take into account any existing |
CM |
266 |
``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. |
|
267 |
|
|
268 |
- The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the |
|
269 |
``SCRIPT_NAME`` in the origin request. |
|
270 |
|
|
271 |
- The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it |
|
272 |
decorated a view found via traversal; it ignored the ``PATH_INFO`` that was |
|
273 |
part of a url-dispatch-matched view. |
|
274 |
|
|
275 |
Deprecations |
|
276 |
------------ |
|
277 |
|
|
278 |
- Deprecated all assignments to ``request.response_*`` attributes (for |
|
279 |
example ``request.response_content_type = 'foo'`` is now deprecated). |
ed7ffe
|
280 |
Assignments and mutations of assignable request attributes that were |
CM |
281 |
considered by the framework for response influence are now deprecated: |
|
282 |
``response_content_type``, ``response_headerlist``, ``response_status``, |
|
283 |
``response_charset``, and ``response_cache_for``. Instead of assigning |
|
284 |
these to the request object for later detection by the rendering machinery, |
|
285 |
users should use the appropriate API of the Response object created by |
|
286 |
accessing ``request.response`` (e.g. code which does |
|
287 |
``request.response_content_type = 'abc'`` should be changed to |
|
288 |
``request.response.content_type = 'abc'``). |
|
289 |
|
|
290 |
- Passing view-related parameters to |
|
291 |
``pyramid.config.Configurator.add_route`` is now deprecated. Previously, a |
|
292 |
view was permitted to be connected to a route using a set of ``view*`` |
|
293 |
parameters passed to the ``add_route`` method of the Configurator. This |
|
294 |
was a shorthand which replaced the need to perform a subsequent call to |
|
295 |
``add_view``. For example, it was valid (and often recommended) to do:: |
|
296 |
|
|
297 |
config.add_route('home', '/', view='mypackage.views.myview', |
|
298 |
view_renderer='some/renderer.pt') |
|
299 |
|
bf8c8f
|
300 |
Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of |
CM |
301 |
connecting a view to a predefined route via ``Configurator.add_view`` using |
|
302 |
the route's ``route_name`` parameter. As a result, the above example |
ed7ffe
|
303 |
should now be spelled:: |
CM |
304 |
|
f426e5
|
305 |
config.add_route('home', '/') |
CM |
306 |
config.add_view('mypackage.views.myview', route_name='home') |
|
307 |
renderer='some/renderer.pt') |
|
308 |
|
|
309 |
This deprecation was done to reduce confusion observed in IRC, as well as |
|
310 |
to (eventually) reduce documentation burden (see also |
|
311 |
https://github.com/Pylons/pyramid/issues/164). A deprecation warning is |
|
312 |
now issued when any view-related parameter is passed to |
|
313 |
``Configurator.add_route``. |
|
314 |
|
|
315 |
- Passing an ``environ`` dictionary to the ``__call__`` method of a |
|
316 |
"traverser" (e.g. an object that implements |
|
317 |
``pyramid.interfaces.ITraverser`` such as an instance of |
|
318 |
``pyramid.traversal.ResourceTreeTraverser``) as its ``request`` argument |
|
319 |
now causes a deprecation warning to be emitted. Consumer code should pass a |
|
320 |
``request`` object instead. The fact that passing an environ dict is |
|
321 |
permitted has been documentation-deprecated since ``repoze.bfg`` 1.1, and |
|
322 |
this capability will be removed entirely in a future version. |
|
323 |
|
|
324 |
- The following (undocumented, dictionary-like) methods of the |
4d9260
|
325 |
``pyramid.request.Request`` object have been deprecated: ``__contains__``, |
CM |
326 |
``__delitem__``, ``__getitem__``, ``__iter__``, ``__setitem__``, ``get``, |
|
327 |
``has_key``, ``items``, ``iteritems``, ``itervalues``, ``keys``, ``pop``, |
|
328 |
``popitem``, ``setdefault``, ``update``, and ``values``. Usage of any of |
|
329 |
these methods will cause a deprecation warning to be emitted. These |
|
330 |
methods were added for internal compatibility in ``repoze.bfg`` 1.1 (code |
|
331 |
that currently expects a request object expected an environ object in BFG |
|
332 |
1.0 and before). In a future version, these methods will be removed |
|
333 |
entirely. |
|
334 |
|
920990
|
335 |
- Deprecated ``pyramid.view.is_response`` function in favor of (newly-added) |
CM |
336 |
``pyramid.request.Request.is_response`` method. Determining if an object |
|
337 |
is truly a valid response object now requires access to the registry, which |
|
338 |
is only easily available as a request attribute. The |
|
339 |
``pyramid.view.is_response`` function will still work until it is removed, |
|
340 |
but now may return an incorrect answer under some (very uncommon) |
|
341 |
circumstances. |
|
342 |
|
4d9260
|
343 |
Behavior Changes |
CM |
344 |
---------------- |
|
345 |
|
18b25a
|
346 |
- The default Mako renderer is now configured to escape all HTML in |
MM |
347 |
expression tags. This is intended to help prevent XSS attacks caused by |
|
348 |
rendering unsanitized input from users. To revert this behavior in user's |
|
349 |
templates, they need to filter the expression through the 'n' filter. |
|
350 |
For example, ${ myhtml | n }. |
|
351 |
See https://github.com/Pylons/pyramid/issues/193. |
|
352 |
|
99edc5
|
353 |
- A custom request factory is now required to return a request object that |
4d9260
|
354 |
has a ``response`` attribute (or "reified"/lazy property) if they the |
CM |
355 |
request is meant to be used in a view that uses a renderer. This |
|
356 |
``response`` attribute should be an instance of the class |
|
357 |
``pyramid.response.Response``. |
|
358 |
|
|
359 |
- The JSON and string renderer factories now assign to |
|
360 |
``request.response.content_type`` rather than |
bf7544
|
361 |
``request.response_content_type``. |
CM |
362 |
|
|
363 |
- Each built-in renderer factory now determines whether it should change the |
|
364 |
content type of the response by comparing the response's content type |
|
365 |
against the response's default content type; if the content type is the |
|
366 |
default content type (usually ``text/html``), the renderer changes the |
|
367 |
content type (to ``application/json`` or ``text/plain`` for JSON and string |
|
368 |
renderers respectively). |
4d9260
|
369 |
|
ba0a5f
|
370 |
- The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of |
CM |
371 |
figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the |
|
372 |
downstream application. As a result, those values may differ slightly from |
|
373 |
the perspective of the downstream application (for example, ``SCRIPT_NAME`` |
|
374 |
will now never possess a trailing slash). |
|
375 |
|
bca03f
|
376 |
- Previously, ``pyramid.request.Request`` inherited from |
CM |
377 |
``webob.request.Request`` and implemented ``__getattr__``, ``__setattr__`` |
|
378 |
and ``__delattr__`` itself in order to overidde "adhoc attr" WebOb behavior |
|
379 |
where attributes of the request are stored in the environ. Now, |
|
380 |
``pyramid.request.Request`` object inherits from (the more recent) |
|
381 |
``webob.request.BaseRequest`` instead of ``webob.request.Request``, which |
|
382 |
provides the same behavior. ``pyramid.request.Request`` no longer |
|
383 |
implements its own ``__getattr__``, ``__setattr__`` or ``__delattr__`` as a |
|
384 |
result. |
|
385 |
|
966b5c
|
386 |
- ``pyramid.response.Response`` is now a *subclass* of |
99edc5
|
387 |
``webob.response.Response`` (in order to directly implement the |
CM |
388 |
``pyramid.interfaces.IResponse`` interface). |
|
389 |
|
53d11e
|
390 |
- The "exception response" objects importable from ``pyramid.httpexceptions`` |
CM |
391 |
(e.g. ``HTTPNotFound``) are no longer just import aliases for classes that |
|
392 |
actually live in ``webob.exc``. Instead, we've defined our own exception |
|
393 |
classes within the module that mirror and emulate the ``webob.exc`` |
1e5e31
|
394 |
exception response objects almost entirely. See the "Design Defense" doc |
CM |
395 |
section named "Pyramid Uses its Own HTTP Exception Classes" for more |
|
396 |
information. |
53d11e
|
397 |
|
d868ff
|
398 |
Backwards Incompatibilities |
CM |
399 |
--------------------------- |
99edc5
|
400 |
|
5484e3
|
401 |
- Pyramid no longer supports Python 2.4. Python 2.5 or better is required to |
CM |
402 |
run Pyramid 1.1+. |
|
403 |
|
99edc5
|
404 |
- The Pyramid router now, by default, expects response objects returned from |
d868ff
|
405 |
view callables to implement the ``pyramid.interfaces.IResponse`` interface. |
CM |
406 |
Unlike the Pyramid 1.0 version of this interface, objects which implement |
|
407 |
IResponse now must define a ``__call__`` method that accepts ``environ`` |
|
408 |
and ``start_response``, and which returns an ``app_iter`` iterable, among |
|
409 |
other things. Previously, it was possible to return any object which had |
|
410 |
the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as |
|
411 |
a response, so this is a backwards incompatibility. It is possible to get |
|
412 |
backwards compatibility back by registering an adapter to IResponse from |
|
413 |
the type of object you're now returning from view callables. See the |
|
414 |
section in the Hooks chapter of the documentation entitled "Changing How |
|
415 |
Pyramid Treats View Responses". |
|
416 |
|
|
417 |
- The ``pyramid.interfaces.IResponse`` interface is now much more extensive. |
|
418 |
Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now |
|
419 |
it is basically intended to directly mirror the ``webob.Response`` API, |
|
420 |
which has many methods and attributes. |
966b5c
|
421 |
|
d0a5f0
|
422 |
- The ``pyramid.httpexceptions`` classes named ``HTTPFound``, |
CM |
423 |
``HTTPMultipleChoices``, ``HTTPMovedPermanently``, ``HTTPSeeOther``, |
|
424 |
``HTTPUseProxy``, and ``HTTPTemporaryRedirect`` now accept ``location`` as |
|
425 |
their first positional argument rather than ``detail``. This means that |
|
426 |
you can do, e.g. ``return pyramid.httpexceptions.HTTPFound('http://foo')`` |
|
427 |
rather than ``return |
|
428 |
pyramid.httpexceptions.HTTPFound(location='http//foo')`` (the latter will |
|
429 |
of course continue to work). |
|
430 |
|
0f7831
|
431 |
Dependencies |
CM |
432 |
------------ |
|
433 |
|
dad904
|
434 |
- Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that |
CM |
435 |
release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``". |
0f7831
|
436 |
(Note that in reality, everyone should probably be using 1.0.4 or better |
CM |
437 |
though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.) |
|
438 |
|
71903a
|
439 |
1.0 (2011-01-30) |
CM |
440 |
================ |
99d8e7
|
441 |
|
CM |
442 |
Documentation |
|
443 |
------------- |
|
444 |
|
|
445 |
- Fixed bug in ZODB Wiki tutorial (missing dependency on ``docutils`` in |
|
446 |
"models" step within ``setup.py``). |
|
447 |
|
d533b1
|
448 |
- Removed API documentation for ``pyramid.testing`` APIs named |
CM |
449 |
``registerDummySecurityPolicy``, ``registerResources``, ``registerModels``, |
|
450 |
``registerEventListener``, ``registerTemplateRenderer``, |
|
451 |
``registerDummyRenderer``, ``registerView``, ``registerUtility``, |
|
452 |
``registerAdapter``, ``registerSubscriber``, ``registerRoute``, |
|
453 |
and ``registerSettings``. |
|
454 |
|
3e4f42
|
455 |
- Moved "Using ZODB With ZEO" and "Using repoze.catalog Within Pyramid" |
CM |
456 |
tutorials out of core documentation and into the Pyramid Tutorials site |
|
457 |
(http://docs.pylonsproject.org/projects/pyramid_tutorials/dev/). |
|
458 |
|
eac198
|
459 |
- Changed "Cleaning up After a Request" section in the URL Dispatch chapter |
CM |
460 |
to use ``request.add_finished_callback`` instead of jamming an object with |
|
461 |
a ``__del__`` into the WSGI environment. |
|
462 |
|
1a4939
|
463 |
- Remove duplication of ``add_route`` API documentation from URL Dispatch |
CM |
464 |
narrative chapter. |
|
465 |
|
|
466 |
- Remove duplication of API and narrative documentation in |
|
467 |
``pyramid.view.view_config`` API docs by pointing to |
|
468 |
``pyramid.config.add_view`` documentation and narrative chapter |
|
469 |
documentation. |
|
470 |
|
|
471 |
- Removed some API documentation duplicated in narrative portions of |
|
472 |
documentation |
|
473 |
|
129007
|
474 |
- Removed "Overall Flow of Authentication" from SQLAlchemy + URL Dispatch |
CM |
475 |
wiki tutorial due to print space concerns (moved to Pyramid Tutorials |
|
476 |
site). |
|
477 |
|
d533b1
|
478 |
Bug Fixes |
CM |
479 |
--------- |
|
480 |
|
|
481 |
- Deprecated-since-BFG-1.2 APIs from ``pyramid.testing`` now properly emit |
|
482 |
deprecation warnings. |
|
483 |
|
9afa52
|
484 |
- Added ``egg:repoze.retry#retry`` middleware to the WSGI pipeline in ZODB |
CM |
485 |
templates (retry ZODB conflict errors which occur in normal operations). |
|
486 |
|
9a27f0
|
487 |
- Removed duplicate implementations of ``is_response``. Two competing |
CM |
488 |
implementations existed: one in ``pyramid.config`` and one in |
|
489 |
``pyramid.view``. Now the one defined in ``pyramid.view`` is used |
|
490 |
internally by ``pyramid.config`` and continues to be advertised as an API. |
|
491 |
|
c61cd1
|
492 |
1.0b3 (2011-01-28) |
CM |
493 |
================== |
bd330c
|
494 |
|
CM |
495 |
Bug Fixes |
|
496 |
--------- |
|
497 |
|
|
498 |
- Use © instead of copyright symbol in paster templates / tutorial |
|
499 |
templates for the benefit of folks who cutnpaste and save to a non-UTF8 |
|
500 |
format. |
|
501 |
|
6ab71c
|
502 |
- ``pyramid.view.append_slash_notfound_view`` now preserves GET query |
CM |
503 |
parameters across redirects. |
|
504 |
|
2021a0
|
505 |
Documentation |
CM |
506 |
------------- |
|
507 |
|
|
508 |
- Beef up documentation related to ``set_default_permission``: explicitly |
|
509 |
mention that default permissions also protect exception views. |
|
510 |
|
82043f
|
511 |
- Paster templates and tutorials now use spaces instead of tabs in their HTML |
c61cd1
|
512 |
templates. |
bd330c
|
513 |
|
237bf1
|
514 |
1.0b2 (2011-01-24) |
CM |
515 |
================== |
a87a68
|
516 |
|
CM |
517 |
Bug Fixes |
|
518 |
--------- |
|
519 |
|
|
520 |
- The ``production.ini`` generated by all paster templates now have an |
|
521 |
effective logging level of WARN, which prevents e.g. SQLAlchemy statement |
|
522 |
logging and other inappropriate output. |
|
523 |
|
|
524 |
- The ``production.ini`` of the ``pyramid_routesalchemy`` and |
|
525 |
``pyramid_alchemy`` paster templates did not have a ``sqlalchemy`` logger |
|
526 |
section, preventing ``paster serve production.ini`` from working. |
|
527 |
|
|
528 |
- The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` paster templates used |
|
529 |
the ``{{package}}`` variable in a place where it should have used the |
|
530 |
``{{project}}`` variable, causing applications created with uppercase |
|
531 |
letters e.g. ``paster create -t pyramid_routesalchemy Dibbus`` to fail to |
|
532 |
start when ``paster serve development.ini`` was used against the result. |
|
533 |
See https://github.com/Pylons/pyramid/issues/#issue/107 |
|
534 |
|
877904
|
535 |
- The ``render_view`` method of ``pyramid.renderers.RendererHelper`` passed |
CM |
536 |
an incorrect value into the renderer for ``renderer_info``. It now passes |
|
537 |
an instance of ``RendererHelper`` instead of a dictionary, which is |
|
538 |
consistent with other usages. See |
|
539 |
https://github.com/Pylons/pyramid/issues#issue/106 |
|
540 |
|
cf3177
|
541 |
- A bug existed in the ``pyramid.authentication.AuthTktCookieHelper`` which |
42a58b
|
542 |
would break any usage of an AuthTktAuthenticationPolicy when one was |
CM |
543 |
configured to reissue its tokens (``reissue_time`` < ``timeout`` / |
|
544 |
``max_age``). Symptom: ``ValueError: ('Invalid token %r', '')``. See |
cf3177
|
545 |
https://github.com/Pylons/pyramid/issues#issue/108. |
CM |
546 |
|
2228ef
|
547 |
1.0b1 (2011-01-21) |
a44845
|
548 |
================== |
acc2a6
|
549 |
|
6fd450
|
550 |
Features |
CM |
551 |
-------- |
|
552 |
|
|
553 |
- The AuthTktAuthenticationPolicy now accepts a ``tokens`` parameter via |
|
554 |
``pyramid.security.remember``. The value must be a sequence of strings. |
|
555 |
Tokens are placed into the auth_tkt "tokens" field and returned in the |
|
556 |
auth_tkt cookie. |
|
557 |
|
d0e101
|
558 |
- Add ``wild_domain`` argument to AuthTktAuthenticationPolicy, which defaults |
CM |
559 |
to ``True``. If it is set to ``False``, the feature of the policy which |
|
560 |
sets a cookie with a wilcard domain will be turned off. |
|
561 |
|
47442f
|
562 |
- Add a ``MANIFEST.in`` file to each paster template. See |
CM |
563 |
https://github.com/Pylons/pyramid/issues#issue/95 |
|
564 |
|
2a13b0
|
565 |
Bug Fixes |
CM |
566 |
--------- |
|
567 |
|
|
568 |
- ``testing.setUp`` now adds a ``settings`` attribute to the registry (both |
|
569 |
when it's passed a registry without any settings and when it creates one). |
|
570 |
|
|
571 |
- The ``testing.setUp`` function now takes a ``settings`` argument, which |
|
572 |
should be a dictionary. Its values will subsequently be available on the |
|
573 |
returned ``config`` object as ``config.registry.settings``. |
|
574 |
|
acc2a6
|
575 |
Documentation |
CM |
576 |
------------- |
|
577 |
|
c88d44
|
578 |
- Added "What's New in Pyramid 1.0" chapter to HTML rendering of |
CM |
579 |
documentation. |
|
580 |
|
acc2a6
|
581 |
- Merged caseman-master narrative editing branch, many wording fixes and |
CM |
582 |
extensions. |
|
583 |
|
9904b3
|
584 |
- Fix deprecated example showing ``chameleon_zpt`` API call in testing |
CM |
585 |
narrative chapter. |
|
586 |
|
14e91b
|
587 |
- Added "Adding Methods to the Configurator via ``add_directive``" section to |
CM |
588 |
Advanced Configuration narrative chapter. |
|
589 |
|
72ad33
|
590 |
- Add docs for ``add_finished_callback``, ``add_response_callback``, |
CM |
591 |
``route_path``, ``route_url``, and ``static_url`` methods to |
|
592 |
``pyramid.request.Request`` API docs. |
|
593 |
|
ddf07e
|
594 |
- Add (minimal) documentation about using I18N within Mako templates to |
CM |
595 |
"Internationalization and Localization" narrative chapter. |
|
596 |
|
770495
|
597 |
- Move content of "Forms" chapter back to "Views" chapter; I can't think of a |
CM |
598 |
better place to put it. |
|
599 |
|
57cc86
|
600 |
- Slightly improved interface docs for ``IAuthorizationPolicy``. |
CM |
601 |
|
65f203
|
602 |
- Minimally explain usage of custom regular expressions in URL dispatch |
CM |
603 |
replacement markers within URL Dispatch chapter. |
|
604 |
|
5f4780
|
605 |
Deprecations |
CM |
606 |
------------- |
|
607 |
|
|
608 |
- Using the ``pyramid.view.bfg_view`` alias for ``pyramid.view.view_config`` |
|
609 |
(a backwards compatibility shim) now issues a deprecation warning. |
|
610 |
|
a05353
|
611 |
Backwards Incompatibilities |
CM |
612 |
--------------------------- |
|
613 |
|
22bac6
|
614 |
- Using ``testing.setUp`` now registers an ISettings utility as a side |
CM |
615 |
effect. Some test code which queries for this utility after |
|
616 |
``testing.setUp`` via queryAdapter will expect a return value of ``None``. |
|
617 |
This code will need to be changed. |
|
618 |
|
a05353
|
619 |
- When a ``pyramid.exceptions.Forbidden`` error is raised, its status code |
CM |
620 |
now ``403 Forbidden``. It was previously ``401 Unauthorized``, for |
|
621 |
backwards compatibility purposes with ``repoze.bfg``. This change will |
|
622 |
cause problems for users of Pyramid with ``repoze.who``, which intercepts |
|
623 |
``401 Unauthorized`` by default, but allows ``403 Forbidden`` to pass |
|
624 |
through. Those deployments will need to configure ``repoze.who`` to also |
|
625 |
react to ``403 Forbidden``. |
|
626 |
|
765336
|
627 |
- The default value for the ``cookie_on_exception`` parameter to |
CM |
628 |
``pyramid.session.UnencyrptedCookieSessionFactory`` is now ``True``. This |
|
629 |
means that when view code causes an exception to be raised, and the session |
|
630 |
has been mutated, a cookie will be sent back in the response. Previously |
|
631 |
its default value was ``False``. |
|
632 |
|
607d75
|
633 |
Paster Templates |
CM |
634 |
---------------- |
|
635 |
|
|
636 |
- The ``pyramid_zodb``, ``pyramid_routesalchemy`` and ``pyramid_alchemy`` |
|
637 |
paster templates now use a default "commit veto" hook when configuring the |
|
638 |
``repoze.tm2`` transaction manager in ``development.ini``. This prevents a |
|
639 |
transaction from being committed when the response status code is within |
|
640 |
the 400 or 500 ranges. See also |
|
641 |
http://docs.repoze.org/tm2/#using-a-commit-veto. |
|
642 |
|
079bb2
|
643 |
1.0a10 (2011-01-18) |
CM |
644 |
=================== |
45b636
|
645 |
|
49315b
|
646 |
Bug Fixes |
BB |
647 |
--------- |
|
648 |
|
059289
|
649 |
- URL dispatch now properly handles a ``.*`` or ``*`` appearing in a regex |
CM |
650 |
match when used inside brackets. Resolves issue #90. |
49315b
|
651 |
|
e333c2
|
652 |
Backwards Incompatibilities |
CM |
653 |
--------------------------- |
|
654 |
|
|
655 |
- The ``add_handler`` method of a Configurator has been removed from the |
|
656 |
Pyramid core. Handlers are now a feature of the ``pyramid_handlers`` |
|
657 |
package, which can be downloaded from PyPI. Documentation for the package |
079bb2
|
658 |
should be available via |
36a3bf
|
659 |
http://pylonsproject.org/projects/pyramid_handlers/dev/, which describes how |
079bb2
|
660 |
to add a configuration statement to your ``main`` block to reobtain this |
CM |
661 |
method. You will also need to add an ``install_requires`` dependency upon |
|
662 |
``pyramid_handlers`` to your ``setup.py`` file. |
e333c2
|
663 |
|
d4b0ea
|
664 |
- The ``load_zcml`` method of a Configurator has been removed from the |
CM |
665 |
Pyramid core. Loading ZCML is now a feature of the ``pyramid_zcml`` |
|
666 |
package, which can be downloaded from PyPI. Documentation for the package |
079bb2
|
667 |
should be available via |
36a3bf
|
668 |
http://pylonsproject.org/projects/pyramid_zcml/dev/, which describes how |
079bb2
|
669 |
to add a configuration statement to your ``main`` block to reobtain this |
CM |
670 |
method. You will also need to add an ``install_requires`` dependency upon |
|
671 |
``pyramid_zcml`` to your ``setup.py`` file. |
d4b0ea
|
672 |
|
CM |
673 |
- The ``pyramid.includes`` subpackage has been removed. ZCML files which use |
|
674 |
include the package ``pyramid.includes`` (e.g. ``<include |
c9c3c4
|
675 |
package="pyramid.includes"/>``) now must include the ``pyramid_zcml`` |
CM |
676 |
package instead (e.g. ``<include package="pyramid_zcml"/>``). |
d4b0ea
|
677 |
|
e333c2
|
678 |
- The ``pyramid.view.action`` decorator has been removed from the Pyramid |
CM |
679 |
core. Handlers are now a feature of the ``pyramid_handlers`` package. It |
|
680 |
should now be imported from ``pyramid_handlers`` e.g. ``from |
|
681 |
pyramid_handlers import action``. |
|
682 |
|
|
683 |
- The ``handler`` ZCML directive has been removed. It is now a feature of |
|
684 |
the ``pyramid_handlers`` package. |
|
685 |
|
2fa576
|
686 |
- The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` paster |
CM |
687 |
templates were removed. Use ``pyramid_sqla`` (available from PyPI) as a |
|
688 |
generic replacement for Pylons-esque development. |
|
689 |
|
c1eb0c
|
690 |
- The ``make_app`` function has been removed from the ``pyramid.router`` |
CM |
691 |
module. It continues life within the ``pyramid_zcml`` package. This |
|
692 |
leaves the ``pyramid.router`` module without any API functions. |
|
693 |
|
|
694 |
- The ``configure_zcml`` setting within the deployment settings (within |
|
695 |
``**settings`` passed to a Pyramid ``main`` function) has ceased to have any |
|
696 |
meaning. |
|
697 |
|
f52d59
|
698 |
Features |
CM |
699 |
-------- |
|
700 |
|
|
701 |
- ``pyramid.testing.setUp`` and ``pyramid.testing.tearDown`` have been |
|
702 |
undeprecated. They are now the canonical setup and teardown APIs for test |
|
703 |
configuration, replacing "direct" creation of a Configurator. This is a |
|
704 |
change designed to provide a facade that will protect against any future |
|
705 |
Configurator deprecations. |
|
706 |
|
f2681a
|
707 |
- Add ``charset`` attribute to ``pyramid.testing.DummyRequest`` |
CM |
708 |
(unconditionally ``UTF-8``). |
|
709 |
|
d93ea2
|
710 |
- Add ``add_directive`` method to configurator, which allows framework |
CM |
711 |
extenders to add methods to the configurator (ala ZCML directives). |
|
712 |
|
08170a
|
713 |
- When ``Configurator.include`` is passed a *module* as an argument, it |
CM |
714 |
defaults to attempting to find and use a callable named ``includeme`` |
|
715 |
within that module. This makes it possible to use |
|
716 |
``config.include('some.module')`` rather than |
|
717 |
``config.include('some.module.somefunc')`` as long as the include function |
|
718 |
within ``some.module`` is named ``includeme``. |
|
719 |
|
c1eb0c
|
720 |
- The ``bfg2pyramid`` script now converts ZCML include tags that have |
CM |
721 |
``repoze.bfg.includes`` as a package attribute to the value |
|
722 |
``pyramid_zcml``. For example, ``<include package="repoze.bfg.includes">`` |
|
723 |
will be converted to ``<include package="pyramid_zcml">``. |
|
724 |
|
f52d59
|
725 |
Paster Templates |
CM |
726 |
---------------- |
|
727 |
|
|
728 |
- All paster templates now use ``pyramid.testing.setUp`` and |
|
729 |
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand" |
|
730 |
within their ``tests.py`` module, as per decision in features above. |
|
731 |
|
079bb2
|
732 |
- The ``starter_zcml`` paster template has been moved to the ``pyramid_zcml`` |
CM |
733 |
package. |
|
734 |
|
f52d59
|
735 |
Documentation |
CM |
736 |
------------- |
|
737 |
|
|
738 |
- The wiki and wiki2 tutorials now use ``pyramid.testing.setUp`` and |
|
739 |
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand", |
|
740 |
as per decision in features above. |
|
741 |
|
|
742 |
- The "Testing" narrative chapter now explains ``pyramid.testing.setUp`` and |
|
743 |
``pyramid.testing.tearDown`` instead of Configurator creation and |
|
744 |
``Configurator.begin()`` and ``Configurator.end()``. |
45b636
|
745 |
|
6a790b
|
746 |
- Document the ``request.override_renderer`` attribute within the narrative |
CM |
747 |
"Renderers" chapter in a section named "Overriding A Renderer at Runtime". |
|
748 |
|
d4b0ea
|
749 |
- The "Declarative Configuration" narrative chapter has been removed (it was |
c9c3c4
|
750 |
moved to the ``pyramid_zcml`` package). |
CM |
751 |
|
|
752 |
- Most references to ZCML in narrative chapters have been removed or |
|
753 |
redirected to ``pyramid_zcml`` locations. |
d4b0ea
|
754 |
|
206188
|
755 |
Deprecations |
CM |
756 |
------------ |
|
757 |
|
|
758 |
- Deprecation warnings related to import of the following API functions were |
|
759 |
added: ``pyramid.traversal.find_model``, ``pyramid.traversal.model_path``, |
|
760 |
``pyramid.traversal.model_path_tuple``, ``pyramid.url.model_url``. The |
|
761 |
instructions emitted by the deprecation warnings instruct the developer to |
|
762 |
change these method spellings to their ``resource`` equivalents. This is a |
|
763 |
consequence of the mass concept rename of "model" to "resource" performed |
|
764 |
in 1.0a7. |
|
765 |
|
a063af
|
766 |
1.0a9 (2011-01-08) |
CM |
767 |
================== |
096c4b
|
768 |
|
afbc5d
|
769 |
Bug Fixes |
CM |
770 |
--------- |
|
771 |
|
|
772 |
- The ``proutes`` command tried too hard to resolve the view for printing, |
|
773 |
resulting in exceptions when an exceptional root factory was encountered. |
|
774 |
Instead of trying to resolve the view, if it cannot, it will now just print |
|
775 |
``<unknown>``. |
bae647
|
776 |
|
07ee47
|
777 |
- The `self` argument was included in new methods of the ``ISession`` interface |
56a8d0
|
778 |
signature, causing ``pyramid_beaker`` tests to fail. |
07ee47
|
779 |
|
8673fb
|
780 |
- Readd ``pyramid.traversal.model_path_tuple`` as an alias for |
CM |
781 |
``pyramid.traversal.resource_path_tuple`` for backwards compatibility. |
|
782 |
|
bae647
|
783 |
Features |
RM |
784 |
-------- |
|
785 |
|
5653d1
|
786 |
- Add a new API ``pyramid.url.current_route_url``, which computes a URL based |
CM |
787 |
on the "current" route (if any) and its matchdict values. |
|
788 |
|
95c9f6
|
789 |
- ``config.add_view`` now accepts a ``decorator`` keyword argument, a callable |
CM |
790 |
which will decorate the view callable before it is added to the registry. |
bae647
|
791 |
|
60eccf
|
792 |
- If a handler class provides an ``__action_decorator__`` attribute (usually |
CM |
793 |
a classmethod or staticmethod), use that as the decorator for each view |
95c9f6
|
794 |
registration for that handler. |
744d76
|
795 |
|
2526d8
|
796 |
- The ``pyramid.interfaces.IAuthenticationPolicy`` interface now specifies an |
CM |
797 |
``unauthenticated_userid`` method. This method supports an important |
|
798 |
optimization required by people who are using persistent storages which do |
|
799 |
not support object caching and whom want to create a "user object" as a |
|
800 |
request attribute. |
|
801 |
|
|
802 |
- A new API has been added to the ``pyramid.security`` module named |
|
803 |
``unauthenticated_userid``. This API function calls the |
|
804 |
``unauthenticated_userid`` method of the effective security policy. |
|
805 |
|
|
806 |
- An ``unauthenticated_userid`` method has been added to the dummy |
|
807 |
authentication policy returned by |
|
808 |
``pyramid.config.Configurator.testing_securitypolicy``. It returns the |
|
809 |
same thing as that the dummy authentication policy's |
|
810 |
``authenticated_userid`` method. |
|
811 |
|
441666
|
812 |
- The class ``pyramid.authentication.AuthTktCookieHelper`` is now an API. |
CM |
813 |
This class can be used by third-party authentication policy developers to |
|
814 |
help in the mechanics of authentication cookie-setting. |
|
815 |
|
d95cd9
|
816 |
- New constructor argument to Configurator: ``default_view_mapper``. Useful |
CM |
817 |
to create systems that have alternate view calling conventions. A view |
|
818 |
mapper allows objects that are meant to be used as view callables to have |
|
819 |
an arbitrary argument list and an arbitrary result. The object passed as |
|
820 |
``default_view_mapper`` should implement the |
|
821 |
``pyramid.interfaces.IViewMapperFactory`` interface. |
|
822 |
|
|
823 |
- add a ``set_view_mapper`` API to Configurator. Has |
|
824 |
the same result as passing ``default_view_mapper`` to the Configurator |
|
825 |
constructor. |
|
826 |
|
5e3d64
|
827 |
- ``config.add_view`` now accepts a ``mapper`` keyword argument, which should |
CM |
828 |
either be ``None``, a string representing a Python dotted name, or an |
|
829 |
object which is an ``IViewMapperFactory``. This feature is not useful for |
|
830 |
"civilians", only for extension writers. |
d95cd9
|
831 |
|
CM |
832 |
- Allow static renderer provided during view registration to be overridden at |
|
833 |
request time via a request attribute named ``override_renderer``, which |
|
834 |
should be the name of a previously registered renderer. Useful to provide |
|
835 |
"omnipresent" RPC using existing rendered views. |
|
836 |
|
51b2e8
|
837 |
- Instances of ``pyramid.testing.DummyRequest`` now have a ``session`` |
CM |
838 |
object, which is mostly a dictionary, but also implements the other session |
|
839 |
API methods for flash and CSRF. |
|
840 |
|
2526d8
|
841 |
Backwards Incompatibilities |
CM |
842 |
--------------------------- |
|
843 |
|
|
844 |
- Since the ``pyramid.interfaces.IAuthenticationPolicy`` interface now |
|
845 |
specifies that a policy implementation must implement an |
|
846 |
``unauthenticated_userid`` method, all third-party custom authentication |
|
847 |
policies now must implement this method. It, however, will only be called |
|
848 |
when the global function named ``pyramid.security.unauthenticated_userid`` |
|
849 |
is invoked, so if you're not invoking that, you will not notice any issues. |
|
850 |
|
14f863
|
851 |
- ``pyramid.interfaces.ISession.get_csrf_token`` now mandates that an |
CM |
852 |
implementation should return a *new* token if one doesn't already exist in |
|
853 |
the session (previously it would return None). The internal sessioning |
|
854 |
implementation has been changed. |
|
855 |
|
7e9d3c
|
856 |
Documentation |
CM |
857 |
------------- |
|
858 |
|
|
859 |
- The (weak) "Converting a CMF Application to Pyramid" tutorial has been |
|
860 |
removed from the tutorials section. It was moved to the |
|
861 |
``pyramid_tutorials`` Github repository. |
|
862 |
|
a65bec
|
863 |
- The "Resource Location and View Lookup" chapter has been replaced with a |
CM |
864 |
variant of Rob Miller's "Much Ado About Traversal" (originally published at |
|
865 |
http://blog.nonsequitarian.org/2010/much-ado-about-traversal/). |
|
866 |
|
|
867 |
- Many minor wording tweaks and refactorings (merged Casey Duncan's docs |
|
868 |
fork, in which he is working on general editing). |
|
869 |
|
8839b6
|
870 |
- Added (weak) description of new view mapper feature to Hooks narrative |
CM |
871 |
chapter. |
|
872 |
|
f3f45a
|
873 |
- Split views chapter into 2: View Callables and View Configuration. |
CM |
874 |
|
|
875 |
- Reorder Renderers and Templates chapters after View Callables but before |
|
876 |
View Configuration. |
|
877 |
|
|
878 |
- Merge Session Objects, Cross-Site Request Forgery, and Flash Messaging |
|
879 |
chapter into a single Sessions chapter. |
|
880 |
|
5b20ad
|
881 |
- The Wiki and Wiki2 tutorials now have much nicer CSS and graphics. |
CM |
882 |
|
95c9f6
|
883 |
Internals |
CM |
884 |
--------- |
|
885 |
|
|
886 |
- The "view derivation" code is now factored into a set of classes rather |
|
887 |
than a large number of standalone functions (a side effect of the |
5e3d64
|
888 |
view mapper refactoring). |
95c9f6
|
889 |
|
CM |
890 |
- The ``pyramid.renderer.RendererHelper`` class has grown a ``render_view`` |
|
891 |
method, which is used by the default view mapper (a side effect of the |
5e3d64
|
892 |
view mapper refactoring). |
95c9f6
|
893 |
|
CM |
894 |
- The object passed as ``renderer`` to the "view deriver" is now an instance |
|
895 |
of ``pyramid.renderers.RendererHelper`` rather than a dictionary (a side |
5e3d64
|
896 |
effect of view mapper refactoring). |
95c9f6
|
897 |
|
13bfb5
|
898 |
- The class used as the "page template" in ``pyramid.chameleon_text`` was |
CM |
899 |
removed, in preference to using a Chameleon-inbuilt version. |
|
900 |
|
95c95b
|
901 |
- A view callable wrapper registered in the registry now contains an |
CM |
902 |
``__original_view__`` attribute which references the original view callable |
|
903 |
(or class). |
|
904 |
|
2526d8
|
905 |
- The (non-API) method of all internal authentication policy implementations |
CM |
906 |
previously named ``_get_userid`` is now named ``unauthenticated_userid``, |
|
907 |
promoted to an API method. If you were overriding this method, you'll now |
|
908 |
need to override it as ``unauthenticated_userid`` instead. |
|
909 |
|
80aa77
|
910 |
- Remove (non-API) function of config.py named _map_view. |
9c1d34
|
911 |
|
636294
|
912 |
1.0a8 (2010-12-27) |
CM |
913 |
================== |
13de5d
|
914 |
|
e6f45b
|
915 |
Bug Fixes |
CM |
916 |
--------- |
|
917 |
|
|
918 |
- The name ``registry`` was not available in the ``paster pshell`` |
|
919 |
environment under IPython. |
|
920 |
|
bac5b3
|
921 |
Features |
CM |
922 |
-------- |
17c4de
|
923 |
|
bac5b3
|
924 |
- If a resource implements a ``__resource_url__`` method, it will be called |
CM |
925 |
as the result of invoking the ``pyramid.url.resource_url`` function to |
|
926 |
generate a URL, overriding the default logic. See the new "Generating The |
|
927 |
URL Of A Resource" section within the Resources narrative chapter. |
|
928 |
|
4df636
|
929 |
- Added flash messaging, as described in the "Flash Messaging" narrative |
CM |
930 |
documentation chapter. |
|
931 |
|
319793
|
932 |
- Added CSRF token generation, as described in the narrative chapter entitled |
CM |
933 |
"Preventing Cross-Site Request Forgery Attacks". |
|
934 |
|
f5bafd
|
935 |
- Prevent misunderstanding of how the ``view`` and ``view_permission`` |
CM |
936 |
arguments to add_route work by raising an exception during configuration if |
|
937 |
view-related arguments exist but no ``view`` argument is passed. |
|
938 |
|
90a327
|
939 |
- Add ``paster proute`` command which displays a summary of the routing |
CM |
940 |
table. See the narrative documentation section within the "URL Dispatch" |
|
941 |
chapter entitled "Displaying All Application Routes". |
|
942 |
|
2a5ae0
|
943 |
Paster Templates |
CM |
944 |
---------------- |
|
945 |
|
|
946 |
- The ``pyramid_zodb`` Paster template no longer employs ZCML. Instead, it |
|
947 |
is based on scanning. |
|
948 |
|
bac5b3
|
949 |
Documentation |
CM |
950 |
------------- |
|
951 |
|
|
952 |
- Added "Generating The URL Of A Resource" section to the Resources narrative |
|
953 |
chapter (includes information about overriding URL generation using |
|
954 |
``__resource_url__``). |
|
955 |
|
|
956 |
- Added "Generating the Path To a Resource" section to the Resources |
|
957 |
narrative chapter. |
|
958 |
|
|
959 |
- Added "Finding a Resource by Path" section to the Resources narrative |
|
960 |
chapter. |
13de5d
|
961 |
|
f4f41f
|
962 |
- Added "Obtaining the Lineage of a Resource" to the Resources narrative |
CM |
963 |
chapter. |
|
964 |
|
|
965 |
- Added "Determining if a Resource is In The Lineage of Another Resource" to |
|
966 |
Resources narrative chapter. |
|
967 |
|
b32bfd
|
968 |
- Added "Finding the Root Resource" to Resources narrative chapter. |
CM |
969 |
|
|
970 |
- Added "Finding a Resource With a Class or Interface in Lineage" to |
|
971 |
Resources narrative chapter. |
|
972 |
|
4df636
|
973 |
- Added a "Flash Messaging" narrative documentation chapter. |
CM |
974 |
|
319793
|
975 |
- Added a narrative chapter entitled "Preventing Cross-Site Request Forgery |
CM |
976 |
Attacks". |
|
977 |
|
2a5ae0
|
978 |
- Changed the "ZODB + Traversal Wiki Tutorial" based on changes to |
CM |
979 |
``pyramid_zodb`` Paster template. |
|
980 |
|
10fd8f
|
981 |
- Added "Advanced Configuration" narrative chapter which documents how to |
CM |
982 |
deal with configuration conflicts, two-phase configuration, ``include`` and |
|
983 |
``commit``. |
|
984 |
|
b33dca
|
985 |
- Fix API documentation rendering for ``pyramid.view.static`` |
CM |
986 |
|
22533d
|
987 |
- Add "Pyramid Provides More Than One Way to Do It" to Design Defense |
CM |
988 |
documentation. |
|
989 |
|
56db9e
|
990 |
- Changed "Static Assets" narrative chapter: clarify that ``name`` represents |
CM |
991 |
a prefix unless it's a URL, added an example of a root-relative static view |
|
992 |
fallback for URL dispatch, added an example of creating a simple view that |
|
993 |
returns the body of a file. |
|
994 |
|
e1a7e0
|
995 |
- Move ZCML usage in Hooks chapter to Declarative Configuration chapter. |
CM |
996 |
|
88b9ee
|
997 |
- Merge "Static Assets" chapter into the "Assets" chapter. |
CM |
998 |
|
90a327
|
999 |
- Added narrative documentation section within the "URL Dispatch" chapter |
CM |
1000 |
entitled "Displaying All Application Routes" (for ``paster proutes`` |
|
1001 |
command). |
|
1002 |
|
bd3bf1
|
1003 |
1.0a7 (2010-12-20) |
CM |
1004 |
================== |
a2796f
|
1005 |
|
aa1ec8
|
1006 |
Terminology Changes |
CM |
1007 |
------------------- |
|
1008 |
|
|
1009 |
- The Pyramid concept previously known as "model" is now known as "resource". |
|
1010 |
As a result: |
|
1011 |
|
|
1012 |
- The following API changes have been made:: |
|
1013 |
|
|
1014 |
pyramid.url.model_url -> |
|
1015 |
pyramid.url.resource_url |
477e99
|
1016 |
|
aa1ec8
|
1017 |
pyramid.traversal.find_model -> |
CM |
1018 |
pyramid.url.find_resource |
477e99
|
1019 |
|
aa1ec8
|
1020 |
pyramid.traversal.model_path -> |
CM |
1021 |
pyramid.traversal.resource_path |
477e99
|
1022 |
|
aa1ec8
|
1023 |
pyramid.traversal.model_path_tuple -> |
CM |
1024 |
pyramid.traversal.resource_path_tuple |
477e99
|
1025 |
|
aa1ec8
|
1026 |
pyramid.traversal.ModelGraphTraverser -> |
CM |
1027 |
pyramid.traversal.ResourceTreeTraverser |
477e99
|
1028 |
|
aa1ec8
|
1029 |
pyramid.config.Configurator.testing_models -> |
CM |
1030 |
pyramid.config.Configurator.testing_resources |
477e99
|
1031 |
|
aa1ec8
|
1032 |
pyramid.testing.registerModels -> |
CM |
1033 |
pyramid.testing.registerResources |
477e99
|
1034 |
|
aa1ec8
|
1035 |
pyramid.testing.DummyModel -> |
CM |
1036 |
pyramid.testing.DummyResource |
|
1037 |
|
|
1038 |
- All documentation which previously referred to "model" now refers to |
bbb9b5
|
1039 |
"resource". |
aa1ec8
|
1040 |
|
CM |
1041 |
- The ``starter`` and ``starter_zcml`` paster templates now have a |
|
1042 |
``resources.py`` module instead of a ``models.py`` module. |
|
1043 |
|
|
1044 |
- Positional argument names of various APIs have been changed from |
|
1045 |
``model`` to ``resource``. |
|
1046 |
|
|
1047 |
Backwards compatibility shims have been left in place in all cases. They |
|
1048 |
will continue to work "forever". |
|
1049 |
|
|
1050 |
- The Pyramid concept previously known as "resource" is now known as "asset". |
|
1051 |
As a result: |
|
1052 |
|
|
1053 |
- The (non-API) module previously known as ``pyramid.resource`` is now |
|
1054 |
known as ``pyramid.asset``. |
|
1055 |
|
|
1056 |
- All docs that previously referred to "resource specification" now refer |
|
1057 |
to "asset specification". |
|
1058 |
|
|
1059 |
- The following API changes were made:: |
|
1060 |
|
|
1061 |
pyramid.config.Configurator.absolute_resource_spec -> |
|
1062 |
pyramid.config.Configurator.absolute_asset_spec |
477e99
|
1063 |
|
aa1ec8
|
1064 |
pyramid.config.Configurator.override_resource -> |
CM |
1065 |
pyramid.config.Configurator.override_asset |
|
1066 |
|
|
1067 |
- The ZCML directive previously known as ``resource`` is now known as |
|
1068 |
``asset``. |
|
1069 |
|
|
1070 |
- The setting previously known as ``BFG_RELOAD_RESOURCES`` (envvar) or |
|
1071 |
``reload_resources`` (config file) is now known, respectively, as |
7b9066
|
1072 |
``PYRAMID_RELOAD_ASSETS`` and ``reload_assets``. |
aa1ec8
|
1073 |
|
CM |
1074 |
Backwards compatibility shims have been left in place in all cases. They |
|
1075 |
will continue to work "forever". |
|
1076 |
|
7906d2
|
1077 |
Bug Fixes |
CM |
1078 |
--------- |
|
1079 |
|
|
1080 |
- Make it possible to succesfully run all tests via ``nosetests`` command |
|
1081 |
directly (rather than indirectly via ``python setup.py nosetests``). |
|
1082 |
|
14b78b
|
1083 |
- When a configuration conflict is encountered during scanning, the conflict |
CM |
1084 |
exception now shows the decorator information that caused the conflict. |
|
1085 |
|
24bf2a
|
1086 |
Features |
CM |
1087 |
-------- |
|
1088 |
|
|
1089 |
- Added ``debug_routematch`` configuration setting that logs matched routes |
|
1090 |
(including the matchdict and predicates). |
|
1091 |
|
dc06b0
|
1092 |
- The name ``registry`` is now available in a ``pshell`` environment by |
CM |
1093 |
default. It is the application registry object. |
|
1094 |
|
e79d36
|
1095 |
Environment |
CM |
1096 |
----------- |
|
1097 |
|
|
1098 |
- All environment variables which used to be prefixed with ``BFG_`` are now |
|
1099 |
prefixed with ``PYRAMID_`` (e.g. ``BFG_DEBUG_NOTFOUND`` is now |
|
1100 |
``PYRAMID_DEBUG_NOTFOUND``) |
|
1101 |
|
24bf2a
|
1102 |
Documentation |
CM |
1103 |
------------- |
|
1104 |
|
|
1105 |
- Added "Debugging Route Matching" section to the urldispatch narrative |
|
1106 |
documentation chapter. |
|
1107 |
|
7b9066
|
1108 |
- Added reference to ``PYRAMID_DEBUG_ROUTEMATCH`` envvar and ``debug_routematch`` |
24bf2a
|
1109 |
config file setting to the Environment narrative docs chapter. |
CM |
1110 |
|
dc06b0
|
1111 |
- Changed "Project" chapter slightly to expand on use of ``paster pshell``. |
CM |
1112 |
|
b3edcf
|
1113 |
- Direct Jython users to Mako rather than Jinja2 in "Install" narrative |
CM |
1114 |
chapter. |
|
1115 |
|
aa1ec8
|
1116 |
- Many changes to support terminological renaming of "model" to "resource" |
CM |
1117 |
and "resource" to "asset". |
|
1118 |
|
6ee49a
|
1119 |
- Added an example of ``WebTest`` functional testing to the testing narrative |
CM |
1120 |
chapter. |
|
1121 |
|
bdb5ed
|
1122 |
- Rearranged chapter ordering by popular demand (URL dispatch first, then |
CM |
1123 |
traversal). Put hybrid chapter after views chapter. |
|
1124 |
|
a59c78
|
1125 |
- Split off "Renderers" as its own chapter from "Views" chapter in narrative |
CM |
1126 |
documentation. |
|
1127 |
|
3f6b38
|
1128 |
Paster Templates |
CM |
1129 |
---------------- |
|
1130 |
|
|
1131 |
- Added ``debug_routematch = false`` to all paster templates. |
|
1132 |
|
14b78b
|
1133 |
Dependencies |
CM |
1134 |
------------ |
|
1135 |
|
|
1136 |
- Depend on Venusian >= 0.5 (for scanning conflict exception decoration). |
|
1137 |
|
07bd03
|
1138 |
1.0a6 (2010-12-15) |
CM |
1139 |
================== |
73b432
|
1140 |
|
c5d172
|
1141 |
Bug Fixes |
CM |
1142 |
--------- |
|
1143 |
|
7cfd68
|
1144 |
- 1.0a5 introduced a bug when ``pyramid.config.Configurator.scan`` was used |
CM |
1145 |
without a ``package`` argument (e.g. ``config.scan()`` as opposed to |
|
1146 |
``config.scan('packagename')``. The symptoms were: lots of deprecation |
|
1147 |
warnings printed to the console about imports of deprecated Pyramid |
43d075
|
1148 |
functions and classes and non-detection of view callables decorated with |
CM |
1149 |
``view_config`` decorators. This has been fixed. |
73b432
|
1150 |
|
86a304
|
1151 |
- Tests now pass on Windows (no bugs found, but a few tests in the test suite |
CM |
1152 |
assumed UNIX path segments in filenames). |
|
1153 |
|
55e60c
|
1154 |
Documentation |
CM |
1155 |
------------- |
|
1156 |
|
|
1157 |
- If you followed it to-the-letter, the ZODB+Traversal Wiki tutorial would |
|
1158 |
instruct you to run a test which would fail because the view callable |
|
1159 |
generated by the ``pyramid_zodb`` tutorial used a one-arg view callable, |
|
1160 |
but the test in the sample code used a two-arg call. |
|
1161 |
|
|
1162 |
- Updated ZODB+Traversal tutorial setup.py of all steps to match what's |
|
1163 |
generated by ``pyramid_zodb``. |
|
1164 |
|
a66a13
|
1165 |
- Fix reference to ``repoze.bfg.traversalwrapper`` in "Models" chapter (point |
CM |
1166 |
at ``pyramid_traversalwrapper`` instead). |
|
1167 |
|
ec8833
|
1168 |
1.0a5 (2010-12-14) |
CM |
1169 |
================== |
aedc21
|
1170 |
|
957f61
|
1171 |
Features |
CM |
1172 |
-------- |
|
1173 |
|
e8edd5
|
1174 |
- Add a ``handler`` ZCML directive. This directive does the same thing as |
CM |
1175 |
``pyramid.configuration.add_handler``. |
|
1176 |
|
d7f259
|
1177 |
- A new module named ``pyramid.config`` was added. It subsumes the duties of |
f360d9
|
1178 |
the older ``pyramid.configuration`` module. |
d7f259
|
1179 |
|
CM |
1180 |
- The new ``pyramid.config.Configurator` class has API methods that the older |
|
1181 |
``pyramid.configuration.Configurator`` class did not: ``with_context`` (a |
|
1182 |
classmethod), ``include``, ``action``, and ``commit``. These methods exist |
|
1183 |
for imperative application extensibility purposes. |
e16ab0
|
1184 |
|
CM |
1185 |
- The ``pyramid.testing.setUp`` function now accepts an ``autocommit`` |
|
1186 |
keyword argument, which defaults to ``True``. If it is passed ``False``, |
|
1187 |
the Config object returned by ``setUp`` will be a non-autocommiting Config |
|
1188 |
object. |
957f61
|
1189 |
|
CM |
1190 |
- Add logging configuration to all paster templates. |
|
1191 |
|
|
1192 |
- ``pyramid_alchemy``, ``pyramid_routesalchemy``, and ``pylons_sqla`` paster |
|
1193 |
templates now use idiomatic SQLAlchemy configuration in their respective |
|
1194 |
``.ini`` files and Python code. |
|
1195 |
|
0cb7ac
|
1196 |
- ``pyramid.testing.DummyRequest`` now has a class variable, |
CM |
1197 |
``query_string``, which defaults to the empty string. |
c5f557
|
1198 |
|
e880a4
|
1199 |
- Add support for json on GAE by catching NotImplementedError and importing |
CM |
1200 |
simplejson from django.utils. |
|
1201 |
|
a9f17c
|
1202 |
- The Mako renderer now accepts a resource specification for |
CM |
1203 |
``mako.module_directory``. |
|
1204 |
|
81e648
|
1205 |
- New boolean Mako settings variable ``mako.strict_undefined``. See `Mako |
CM |
1206 |
Context Variables |
|
1207 |
<http://www.makotemplates.org/docs/runtime.html#context-variables>`_ for |
|
1208 |
its meaning. |
|
1209 |
|
|
1210 |
Dependencies |
|
1211 |
------------ |
|
1212 |
|
|
1213 |
- Depend on Mako 0.3.6+ (we now require the ``strict_undefined`` feature). |
|
1214 |
|
b44b93
|
1215 |
Bug Fixes |
CM |
1216 |
--------- |
|
1217 |
|
a56564
|
1218 |
- When creating a Configurator from within a ``paster pshell`` session, you |
CM |
1219 |
were required to pass a ``package`` argument although ``package`` is not |
|
1220 |
actually required. If you didn't pass ``package``, you would receive an |
|
1221 |
error something like ``KeyError: '__name__'`` emanating from the |
|
1222 |
``pyramid.path.caller_module`` function. This has now been fixed. |
|
1223 |
|
b44b93
|
1224 |
- The ``pyramid_routesalchemy`` paster template's unit tests failed |
CM |
1225 |
(``AssertionError: 'SomeProject' != 'someproject'``). This is fixed. |
|
1226 |
|
76e48b
|
1227 |
- Make default renderer work (renderer factory registered with no name, which |
CM |
1228 |
is active for every view unless the view names a specific renderer). |
|
1229 |
|
a9f17c
|
1230 |
- The Mako renderer did not properly turn the ``mako.imports``, |
CM |
1231 |
``mako.default_filters``, and ``mako.imports`` settings into lists. |
|
1232 |
|
|
1233 |
- The Mako renderer did not properly convert the ``mako.error_handler`` |
|
1234 |
setting from a dotted name to a callable. |
|
1235 |
|
2197ff
|
1236 |
Documentation |
CM |
1237 |
------------- |
|
1238 |
|
ec8833
|
1239 |
- Merged many wording, readability, and correctness changes to narrative |
CM |
1240 |
documentation chapters from https://github.com/caseman/pyramid (up to and |
|
1241 |
including "Models" narrative chapter). |
|
1242 |
|
2197ff
|
1243 |
- "Sample Applications" section of docs changed to note existence of Cluegun, |
CM |
1244 |
Shootout and Virginia sample applications, ported from their repoze.bfg |
|
1245 |
origin packages. |
|
1246 |
|
d0e2f6
|
1247 |
- SQLAlchemy+URLDispatch tutorial updated to integrate changes to |
CM |
1248 |
``pyramid_routesalchemy`` template. |
|
1249 |
|
e26903
|
1250 |
- Add ``pyramid.interfaces.ITemplateRenderer`` interface to Interfaces API |
CM |
1251 |
chapter (has ``implementation()`` method, required to be used when getting |
|
1252 |
at Chameleon macros). |
|
1253 |
|
aa3306
|
1254 |
- Add a "Modifying Package Structure" section to the project narrative |
CM |
1255 |
documentation chapter (explain turning a module into a package). |
aedc21
|
1256 |
|
4d660d
|
1257 |
- Documentation was added for the new ``handler`` ZCML directive in the ZCML |
CM |
1258 |
section. |
|
1259 |
|
f360d9
|
1260 |
Deprecations |
CM |
1261 |
------------ |
|
1262 |
|
|
1263 |
- ``pyramid.configuration.Configurator`` is now deprecated. Use |
|
1264 |
``pyramid.config.Configurator``, passing its constructor |
|
1265 |
``autocommit=True`` instead. The ``pyramid.configuration.Configurator`` |
|
1266 |
alias will live for a long time, as every application uses it, but its |
|
1267 |
import now issues a deprecation warning. The |
|
1268 |
``pyramid.config.Configurator`` class has the same API as |
|
1269 |
``pyramid.configuration.Configurator`` class, which it means to replace, |
|
1270 |
except by default it is a *non-autocommitting* configurator. The |
|
1271 |
now-deprecated ``pyramid.configuration.Configurator`` will autocommit every |
|
1272 |
time a configuration method is called. |
|
1273 |
|
|
1274 |
The ``pyramid.configuration`` module remains, but it is deprecated. Use |
|
1275 |
``pyramid.config`` instead. |
|
1276 |
|
7eb4ad
|
1277 |
1.0a4 (2010-11-21) |
CM |
1278 |
================== |
745a61
|
1279 |
|
2c9d14
|
1280 |
Features |
CM |
1281 |
-------- |
|
1282 |
|
e84116
|
1283 |
- URL Dispatch now allows for replacement markers to be located anywhere |
BB |
1284 |
in the pattern, instead of immediately following a ``/``. |
47c9f8
|
1285 |
|
4018ad
|
1286 |
- URL Dispatch now uses the form ``{marker}`` to denote a replace marker in |
7eb4ad
|
1287 |
the route pattern instead of ``:marker``. The old colon-style marker syntax |
CM |
1288 |
is still accepted for backwards compatibility. The new format allows a |
|
1289 |
regular expression for that marker location to be used instead of the |
|
1290 |
default ``[^/]+``, for example ``{marker:\d+}`` is now valid to require the |
|
1291 |
marker to be digits. |
47c9f8
|
1292 |
|
2c9d14
|
1293 |
- Add a ``pyramid.url.route_path`` API, allowing folks to generate relative |
CM |
1294 |
URLs. Calling ``route_path`` is the same as calling |
|
1295 |
``pyramid.url.route_url`` with the argument ``_app_url`` equal to the empty |
|
1296 |
string. |
|
1297 |
|
|
1298 |
- Add a ``pyramid.request.Request.route_path`` API. This is a convenience |
|
1299 |
method of the request which calls ``pyramid.url.route_url``. |
|
1300 |
|
85ee02
|
1301 |
- Make test suite pass on Jython (requires PasteScript trunk, presumably to |
CM |
1302 |
be 1.7.4). |
|
1303 |
|
29b7aa
|
1304 |
- Make test suite pass on PyPy (Chameleon doesn't work). |
CM |
1305 |
|
614f00
|
1306 |
- Surrounding application configuration with ``config.begin()`` and |
CM |
1307 |
``config.end()`` is no longer necessary. All paster templates have been |
|
1308 |
changed to no longer call these functions. |
|
1309 |
|
35ce2a
|
1310 |
- Fix configurator to not convert ``ImportError`` to ``ConfigurationError`` |
CM |
1311 |
if the import that failed was unrelated to the import requested via a |
|
1312 |
dotted name when resolving dotted names (such as view dotted names). |
|
1313 |
|
614f00
|
1314 |
Documentation |
CM |
1315 |
------------- |
|
1316 |
|
|
1317 |
- SQLAlchemy+URLDispatch and ZODB+Traversal tutorials have been updated to |
|
1318 |
not call ``config.begin()`` or ``config.end()``. |
|
1319 |
|
111a6f
|
1320 |
Bug Fixes |
CM |
1321 |
--------- |
|
1322 |
|
|
1323 |
- Add deprecation warnings to import of ``pyramid.chameleon_text`` and |
|
1324 |
``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``, |
|
1325 |
``render_template``, and ``render_template_to_response``. |
|
1326 |
|
34f44d
|
1327 |
- Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and |
CM |
1328 |
``pyramid.zcml.file_configure``. |
|
1329 |
|
1e00f3
|
1330 |
- The ``pyramid_alchemy`` paster template had a typo, preventing an import |
CM |
1331 |
from working. |
|
1332 |
|
a66593
|
1333 |
- Fix apparent failures when calling ``pyramid.traversal.find_model(root, |
CM |
1334 |
path)`` or ``pyramid.traversal.traverse(path)`` when ``path`` is |
|
1335 |
(erroneously) a Unicode object. The user is meant to pass these APIs a |
|
1336 |
string object, never a Unicode object. In practice, however, users indeed |
|
1337 |
pass Unicode. Because the string that is passed must be ASCII encodeable, |
|
1338 |
now, if they pass a Unicode object, its data is eagerly converted to an |
|
1339 |
ASCII string rather than being passed along to downstream code as a |
|
1340 |
convenience to the user and to prevent puzzling second-order failures from |
|
1341 |
cropping up (all failures will occur within ``pyramid.traversal.traverse`` |
7eb4ad
|
1342 |
rather than later down the line as the result of calling e.g. |
a66593
|
1343 |
``traversal_path``). |
CM |
1344 |
|
34f44d
|
1345 |
Backwards Incompatibilities |
CM |
1346 |
--------------------------- |
|
1347 |
|
|
1348 |
- The ``pyramid.testing.zcml_configure`` API has been removed. It had been |
406259
|
1349 |
advertised as removed since repoze.bfg 1.2a1, but hadn't actually been. |
34f44d
|
1350 |
|
b68aad
|
1351 |
Deprecations |
CM |
1352 |
------------ |
|
1353 |
|
|
1354 |
- The ``pyramid.settings.get_settings`` API is now deprecated. Use |
84df81
|
1355 |
``pyramid.threadlocals.get_current_registry().settings`` instead or use the |
b68aad
|
1356 |
``settings`` attribute of the registry available from the request |
CM |
1357 |
(``request.registry.settings``). |
745a61
|
1358 |
|
cb96e2
|
1359 |
Documentation |
CM |
1360 |
------------- |
|
1361 |
|
|
1362 |
- Removed ``zodbsessions`` tutorial chapter. It's still useful, but we now |
|
1363 |
have a SessionFactory abstraction which competes with it, and maintaining |
|
1364 |
documentation on both ways to do it is a distraction. |
|
1365 |
|
dbaa08
|
1366 |
Internal |
CM |
1367 |
-------- |
|
1368 |
|
|
1369 |
- Replace Twill with WebTest in internal integration tests (avoid deprecation |
|
1370 |
warnings generated by Twill). |
|
1371 |
|
3fa994
|
1372 |
1.0a3 (2010-11-16) |
CM |
1373 |
================== |
f4d693
|
1374 |
|
9cca72
|
1375 |
Features |
CM |
1376 |
-------- |
|
1377 |
|
ae60ba
|
1378 |
- Added Mako TemplateLookup settings for ``mako.error_handler``, |
BB |
1379 |
``mako.default_filters``, and ``mako.imports``. |
|
1380 |
|
9cca72
|
1381 |
- Normalized all paster templates: each now uses the name ``main`` to |
CM |
1382 |
represent the function that returns a WSGI application, each now uses |
|
1383 |
WebError, each now has roughly the same shape of development.ini style. |
|
1384 |
|
51c305
|
1385 |
- Added class vars ``matchdict`` and ``matched_route`` to |
CR |
1386 |
``pyramid.request.Request``. Each is set to ``None``. |
|
1387 |
|
fe4172
|
1388 |
- New API method: ``pyramid.settings.asbool``. |
CM |
1389 |
|
9e2e1c
|
1390 |
- New API methods for ``pyramid.request.Request``: ``model_url``, |
CM |
1391 |
``route_url``, and ``static_url``. These are simple passthroughs for their |
|
1392 |
respective functions in ``pyramid.url``. |
4eafaa
|
1393 |
|
5a972b
|
1394 |
- The ``settings`` object which used to be available only when |
CM |
1395 |
``request.settings.get_settings`` was called is now available as |
|
1396 |
``registry.settings`` (e.g. ``request.registry.settings`` in view code). |
|
1397 |
|
9cca72
|
1398 |
Bug Fixes |
CM |
1399 |
--------- |
|
1400 |
|
|
1401 |
- The pylons_* paster templates erroneously used the ``{squiggly}`` routing |
|
1402 |
syntax as the pattern supplied to ``add_route``. This style of routing is |
|
1403 |
not supported. They were replaced with ``:colon`` style route patterns. |
f4d693
|
1404 |
|
7bd14c
|
1405 |
- The pylons_* paster template used the same string |
CM |
1406 |
(``your_app_secret_string``) for the ``session.secret`` setting in the |
|
1407 |
generated ``development.ini``. This was a security risk if left unchanged |
|
1408 |
in a project that used one of the templates to produce production |
|
1409 |
applications. It now uses a randomly generated string. |
|
1410 |
|
1ad856
|
1411 |
Documentation |
CM |
1412 |
------------- |
|
1413 |
|
|
1414 |
- ZODB+traversal wiki (``wiki``) tutorial updated due to changes to |
|
1415 |
``pyramid_zodb`` paster template. |
|
1416 |
|
40eb89
|
1417 |
- SQLAlchemy+urldispach wiki (``wiki2``) tutorial updated due to changes to |
CM |
1418 |
``pyramid_routesalchemy`` paster template. |
|
1419 |
|
4eafaa
|
1420 |
- Documented the ``matchdict`` and ``matched_route`` attributes of the |
CM |
1421 |
request object in the Request API documentation. |
|
1422 |
|
5a972b
|
1423 |
Deprecations |
CM |
1424 |
------------ |
|
1425 |
|
|
1426 |
- Obtaining the ``settings`` object via |
|
1427 |
``registry.{get|query}Utility(ISettings)`` is now deprecated. Instead, |
|
1428 |
obtain the ``settings`` object via the ``registry.settings`` attribute. A |
|
1429 |
backwards compatibility shim was added to the registry object to register |
|
1430 |
the settings object as an ISettings utility when ``setattr(registry, |
|
1431 |
'settings', foo)`` is called, but it will be removed in a later release. |
|
1432 |
|
|
1433 |
- Obtaining the ``settings`` object via ``pyramid.settings.get_settings`` is |
|
1434 |
now deprecated. Obtain it as the ``settings`` attribute of the registry |
|
1435 |
now (obtain the registry via ``pyramid.threadlocal.get_registry`` or as |
|
1436 |
``request.registry``). |
|
1437 |
|
76d7eb
|
1438 |
Behavior Differences |
CM |
1439 |
-------------------- |
|
1440 |
|
|
1441 |
- Internal: ZCML directives no longer call get_current_registry() if there's |
|
1442 |
a ``registry`` attribute on the ZCML context (kill off use of |
|
1443 |
threadlocals). |
|
1444 |
|
7b8d65
|
1445 |
- Internal: Chameleon template renderers now accept two arguments: ``path`` |
CM |
1446 |
and ``lookup``. ``Lookup`` will be an instance of a lookup class which |
|
1447 |
supplies (late-bound) arguments for debug, reload, and translate. Any |
|
1448 |
third-party renderers which use (the non-API) function |
|
1449 |
``pyramid.renderers.template_renderer_factory`` will need to adjust their |
|
1450 |
implementations to obey the new callback argument list. This change was to |
|
1451 |
kill off inappropriate use of threadlocals. |
|
1452 |
|
3d4e56
|
1453 |
1.0a2 (2010-11-09) |
CM |
1454 |
================== |
0af394
|
1455 |
|
c721fd
|
1456 |
Documentation |
CM |
1457 |
------------- |
|
1458 |
|
|
1459 |
- All references to events by interface |
|
1460 |
(e.g. ``pyramid.interfaces.INewRequest``) have been changed to reference |
|
1461 |
their concrete classes (e.g. ``pyramid.events.NewRequest``) in |
|
1462 |
documentation about making subscriptions. |
|
1463 |
|
3d4e56
|
1464 |
- All references to Pyramid-the-application were changed from mod-`pyramid` |
CM |
1465 |
to app-`Pyramid`. A custom role setting was added to ``docs/conf.py`` to |
fd5ae9
|
1466 |
allow for this. (internal) |
CM |
1467 |
|
fcc3d1
|
1468 |
1.0a1 (2010-11-05) |
CM |
1469 |
================== |
5bbc23
|
1470 |
|
fcc3d1
|
1471 |
Features (delta from BFG 1.3) |
2e6905
|
1472 |
------------------------------- |
CM |
1473 |
|
07437c
|
1474 |
- Mako templating renderer supports resource specification format for |
BB |
1475 |
template lookups and within Mako templates. Absolute filenames must |
a62cc2
|
1476 |
be used in Pyramid to avoid this lookup process. |
07437c
|
1477 |
|
2e6905
|
1478 |
- Add ``pyramid.httpexceptions`` module, which is a facade for the |
CM |
1479 |
``webob.exc`` module. |
|
1480 |
|
9b8d0c
|
1481 |
- Direct built-in support for the Mako templating language. |
CM |
1482 |
|
|
1483 |
- A new configurator method exists: ``add_handler``. This method adds |
|
1484 |
a Pylons-style "view handler" (such a thing used to be called a |
|
1485 |
"controller" in Pylons 1.0). |
|
1486 |
|
968209
|
1487 |
- New argument to configurator: ``session_factory``. |
CM |
1488 |
|
|
1489 |
- New method on configurator: ``set_session_factory`` |
|
1490 |
|
|
1491 |
- Using ``request.session`` now returns a (dictionary-like) session |
|
1492 |
object if a session factory has been configured. |
14dc81
|
1493 |
|
CM |
1494 |
- The request now has a new attribute: ``tmpl_context`` for benefit of |
|
1495 |
Pylons users. |
|
1496 |
|
197f0c
|
1497 |
- The decorator previously known as ``pyramid.view.bfg_view`` is now |
CM |
1498 |
known most formally as ``pyramid.view.view_config`` in docs and |
|
1499 |
paster templates. An import of ``pyramid.view.bfg_view``, however, |
|
1500 |
will continue to work "forever". |
|
1501 |
|
6a3184
|
1502 |
- New API methods in ``pyramid.session``: ``signed_serialize`` and |
CM |
1503 |
``signed_deserialize``. |
|
1504 |
|
1dad60
|
1505 |
- New interface: ``pyramid.interfaces.IRendererInfo``. An object of this type |
CM |
1506 |
is passed to renderer factory constructors (see "Backwards |
|
1507 |
Incompatibilities"). |
|
1508 |
|
a76e99
|
1509 |
- New event type: ``pyramid.interfaces.IBeforeRender``. An object of this type |
CM |
1510 |
is sent as an event before a renderer is invoked (but after the |
|
1511 |
application-level renderer globals factory added via |
|
1512 |
``pyramid.configurator.configuration.set_renderer_globals_factory``, if any, |
|
1513 |
has injected its own keys). Applications may now subscribe to the |
|
1514 |
``IBeforeRender`` event type in order to introspect the and modify the set of |
|
1515 |
renderer globals before they are passed to a renderer. The event object |
|
1516 |
iself has a dictionary-like interface that can be used for this purpose. For |
|
1517 |
example:: |
|
1518 |
|
|
1519 |
from repoze.events import subscriber |
|
1520 |
from pyramid.interfaces import IRendererGlobalsEvent |
|
1521 |
|
|
1522 |
@subscriber(IRendererGlobalsEvent) |
|
1523 |
def add_global(event): |
|
1524 |
event['mykey'] = 'foo' |
|
1525 |
|
|
1526 |
If a subscriber attempts to add a key that already exist in the renderer |
|
1527 |
globals dictionary, a ``KeyError`` is raised. This limitation is due to the |
|
1528 |
fact that subscribers cannot be ordered relative to each other. The set of |
|
1529 |
keys added to the renderer globals dictionary by all subscribers and |
|
1530 |
app-level globals factories must be unique. |
|
1531 |
|
e65e5b
|
1532 |
- New class: ``pyramid.response.Response``. This is a pure facade for |
CM |
1533 |
``webob.Response`` (old code need not change to use this facade, it's |
94b889
|
1534 |
existence is mostly for vanity and documentation-generation purposes). |
CM |
1535 |
|
a3dc13
|
1536 |
- All preexisting paster templates (except ``zodb``) now use "imperative" |
CM |
1537 |
configuration (``starter``, ``routesalchemy``, ``alchemy``). |
|
1538 |
|
|
1539 |
- A new paster template named ``pyramid_starter_zcml`` exists, which uses |
|
1540 |
declarative configuration. |
|
1541 |
|
2e6905
|
1542 |
Documentation (delta from BFG 1.3) |
CM |
1543 |
----------------------------------- |
|
1544 |
|
|
1545 |
- Added a ``pyramid.httpexceptions`` API documentation chapter. |
|
1546 |
|
14dc81
|
1547 |
- Added a ``pyramid.session`` API documentation chapter. |
CM |
1548 |
|
|
1549 |
- Added a ``Session Objects`` narrative documentation chapter. |
|
1550 |
|
|
1551 |
- Added an API chapter for the ``pyramid.personality`` module. |
|
1552 |
|
94b889
|
1553 |
- Added an API chapter for the ``pyramid.response`` module. |
CM |
1554 |
|
|
1555 |
- All documentation which previously referred to ``webob.Response`` now uses |
|
1556 |
``pyramid.response.Response`` instead. |
|
1557 |
|
7a3465
|
1558 |
- The documentation has been overhauled to use imperative configuration, |
CM |
1559 |
moving declarative configuration (ZCML) explanations to a separate |
|
1560 |
narrative chapter ``declarative.rst``. |
|
1561 |
|
b3b713
|
1562 |
- The ZODB Wiki tutorial was updated to take into account changes to the |
CM |
1563 |
``pyramid_zodb`` paster template. |
|
1564 |
|
b2adfe
|
1565 |
- The SQL Wiki tutorial was updated to take into account changes to the |
CM |
1566 |
``pyramid_routesalchemy`` paster template. |
6067de
|
1567 |
|
fcc3d1
|
1568 |
Backwards Incompatibilities (with BFG 1.3) |
CM |
1569 |
------------------------------------------ |
2d7993
|
1570 |
|
c81aad
|
1571 |
- There is no longer an ``IDebugLogger`` registered as a named utility |
CM |
1572 |
with the name ``repoze.bfg.debug``. |
|
1573 |
|
|
1574 |
- The logger which used to have the name of ``repoze.bfg.debug`` now |
|
1575 |
has the name ``pyramid.debug``. |
|
1576 |
|
588733
|
1577 |
- The deprecated API ``pyramid.testing.registerViewPermission`` |
CM |
1578 |
has been removed. |
|
1579 |
|
51c305
|
1580 |
- The deprecated API named ``pyramid.testing.registerRoutesMapper`` |
588733
|
1581 |
has been removed. |
CM |
1582 |
|
c81aad
|
1583 |
- The deprecated API named ``pyramid.request.get_request`` was removed. |
CM |
1584 |
|
|
1585 |
- The deprecated API named ``pyramid.security.Unauthorized`` was |
|
1586 |
removed. |
|
1587 |
|
|
1588 |
- The deprecated API named ``pyramid.view.view_execution_permitted`` |
|
1589 |
was removed. |
|
1590 |
|
|
1591 |
- The deprecated API named ``pyramid.view.NotFound`` was removed. |
6a3184
|
1592 |
|
CM |
1593 |
- The ``bfgshell`` paster command is now named ``pshell``. |
|
1594 |
|
cba2e1
|
1595 |
- The Venusian "category" for all built-in Venusian decorators |
CM |
1596 |
(e.g. ``subscriber`` and ``view_config``/``bfg_view``) is now |
|
1597 |
``pyramid`` instead of ``bfg``. |
3d9dd0
|
1598 |
|
CM |
1599 |
- ``pyramid.renderers.rendered_response`` function removed; use |
|
1600 |
``render_pyramid.renderers.render_to_response`` instead. |
|
1601 |
|
1dad60
|
1602 |
- Renderer factories now accept a *renderer info object* rather than an |
CM |
1603 |
absolute resource specification or an absolute path. The object has the |
|
1604 |
following attributes: ``name`` (the ``renderer=`` value), ``package`` (the |
|
1605 |
'current package' when the renderer configuration statement was found), |
|
1606 |
``type``: the renderer type, ``registry``: the current registry, and |
|
1607 |
``settings``: the deployment settings dictionary. |
3d9dd0
|
1608 |
|
CM |
1609 |
Third-party ``repoze.bfg`` renderer implementations that must be ported to |
|
1610 |
Pyramid will need to account for this. |
|
1611 |
|
f5fa3f
|
1612 |
This change was made primarily to support more flexible Mako template |
CM |
1613 |
rendering. |
2876a8
|
1614 |
|
CM |
1615 |
- The presence of the key ``repoze.bfg.message`` in the WSGI environment when |
|
1616 |
an exception occurs is now deprecated. Instead, code which relies on this |
|
1617 |
environ value should use the ``exception`` attribute of the request |
|
1618 |
(e.g. ``request.exception[0]``) to retrieve the message. |
8129f9
|
1619 |
|
CM |
1620 |
- The values ``bfg_localizer`` and ``bfg_locale_name`` kept on the request |
|
1621 |
during internationalization for caching purposes were never APIs. These |
|
1622 |
however have changed to ``localizer`` and ``locale_name``, respectively. |
|
1623 |
|
968f46
|
1624 |
- The default ``cookie_name`` value of the ``authtktauthenticationpolicy`` ZCML |
CM |
1625 |
now defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``). |
|
1626 |
|
|
1627 |
- The default ``cookie_name`` value of the |
|
1628 |
``pyramid.authentication.AuthTktAuthenticationPolicy`` constructor now |
|
1629 |
defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``). |
7a3465
|
1630 |
|
a3dc13
|
1631 |
- The ``request_type`` argument to the ``view`` ZCML directive, the |
CM |
1632 |
``pyramid.configuration.Configurator.add_view`` method, or the |
|
1633 |
``pyramid.view.view_config`` decorator (nee ``bfg_view``) is no longer |
|
1634 |
permitted to be one of the strings ``GET``, ``HEAD``, ``PUT``, ``POST`` or |
|
1635 |
``DELETE``, and now must always be an interface. Accepting the |
|
1636 |
method-strings as ``request_type`` was a backwards compatibility strategy |
|
1637 |
servicing repoze.bfg 1.0 applications. Use the ``request_method`` |
|
1638 |
parameter instead to specify that a view a string request-method predicate. |