commit | author | age
|
5bee60
|
1 |
1.2a2 (2011-08-27) |
CM |
2 |
================== |
|
3 |
|
|
4 |
Bug Fixes |
|
5 |
--------- |
b93af9
|
6 |
|
CM |
7 |
- When a ``renderers=`` argument is not specified to the Configurator |
|
8 |
constructor, eagerly register and commit the default renderer set. This |
|
9 |
permits the overriding of the default renderers, which was broken in 1.2a1 |
|
10 |
without a commit directly after Configurator construction. |
|
11 |
|
8b62d7
|
12 |
- Mako rendering exceptions had the wrong value for an error message. |
CM |
13 |
|
2a818a
|
14 |
- An include could not set a root factory successfully because the |
CM |
15 |
Configurator constructor unconditionally registered one that would be |
|
16 |
treated as if it were "the word of the user". |
|
17 |
|
5bee60
|
18 |
Features |
CM |
19 |
-------- |
|
20 |
|
637bda
|
21 |
- A session factory can now be passed in using the dotted name syntax. |
CM |
22 |
|
c1a179
|
23 |
1.2a1 (2011-08-24) |
CM |
24 |
================== |
9a66aa
|
25 |
|
CM |
26 |
Features |
|
27 |
-------- |
|
28 |
|
5ec330
|
29 |
- The ``[pshell]`` section in an ini configuration file now treats a |
CM |
30 |
``setup`` key as a dotted name that points to a callable that is passed the |
|
31 |
bootstrap environment. It can mutate the environment as necessary for |
|
32 |
great justice. |
|
33 |
|
473697
|
34 |
- A new configuration setting named ``pyramid.includes`` is now available. |
CM |
35 |
It is described in the "Environment Variables and ``.ini`` Files Settings" |
|
36 |
narrative documentation chapter. |
|
37 |
|
83bf91
|
38 |
- Added a ``route_prefix`` argument to the |
CM |
39 |
``pyramid.config.Configurator.include`` method. This argument allows you |
|
40 |
to compose URL dispatch applications together. See the section entitled |
|
41 |
"Using a Route Prefix to Compose Applications" in the "URL Dispatch" |
|
42 |
narrative documentation chapter. |
|
43 |
|
1e88db
|
44 |
- Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in |
CM |
45 |
``permission=`` statements to view configuration. This constant has a |
|
46 |
value of the string ``__no_permission_required__``. This string value was |
|
47 |
previously referred to in documentation; now the documentation uses the |
|
48 |
constant. |
|
49 |
|
1f901a
|
50 |
- Added a decorator-based way to configure a response adapter: |
CM |
51 |
``pyramid.response.response_adapter``. This decorator has the same use as |
|
52 |
``pyramid.config.Configurator.add_response_adapter`` but it's declarative. |
|
53 |
|
9a66aa
|
54 |
- The ``pyramid.events.BeforeRender`` event now has an attribute named |
CM |
55 |
``rendering_val``. This can be used to introspect the value returned by a |
|
56 |
view in a BeforeRender subscriber. |
|
57 |
|
6b2a62
|
58 |
- New configurator directive: ``pyramid.config.Configurator.add_tween``. |
CM |
59 |
This directive adds a "tween". A "tween" is used to wrap the Pyramid |
|
60 |
router's primary request handling function. This is a feature may be used |
|
61 |
by Pyramid framework extensions, to provide, for example, view timing |
|
62 |
support and as a convenient place to hang bookkeeping code. |
af2323
|
63 |
|
6b2a62
|
64 |
Tweens are further described in the narrative docs section in the Hooks |
CM |
65 |
chapter, named "Registering Tweens". |
af2323
|
66 |
|
6b2a62
|
67 |
- New paster command ``paster ptweens``, which prints the current "tween" |
CM |
68 |
configuration for an application. See the section entitled "Displaying |
|
69 |
Tweens" in the Command-Line Pyramid chapter of the narrative documentation |
|
70 |
for more info. |
b72379
|
71 |
|
3a8054
|
72 |
- The Pyramid debug logger now uses the standard logging configuration |
CM |
73 |
(usually set up by Paste as part of startup). This means that output from |
|
74 |
e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the |
|
75 |
normal logging channels. The logger name of the debug logger will be the |
|
76 |
package name of the *caller* of the Configurator's constructor. |
|
77 |
|
95a379
|
78 |
- A new attribute is available on request objects: ``exc_info``. Its value |
CM |
79 |
will be ``None`` until an exception is caught by the Pyramid router, after |
|
80 |
which it will be the result of ``sys.exc_info()``. |
6b2a62
|
81 |
|
274435
|
82 |
- ``pyramid.testing.DummyRequest`` now implements the |
CM |
83 |
``add_finished_callback`` and ``add_response_callback`` methods. |
|
84 |
|
1a42bd
|
85 |
- New methods of the ``pyramid.config.Configurator`` class: |
CM |
86 |
``set_authentication_policy`` and ``set_authorization_policy``. These are |
|
87 |
meant to be consumed mostly by add-on authors. |
|
88 |
|
ea824f
|
89 |
- New Configurator method: ``set_root_factory``. |
CM |
90 |
|
|
91 |
- Pyramid no longer eagerly commits some default configuration statements at |
|
92 |
Configurator construction time, which permits values passed in as |
|
93 |
constructor arguments (e.g. ``authentication_policy`` and |
|
94 |
``authorization_policy``) to override the same settings obtained via an |
|
95 |
"include". |
|
96 |
|
9f7f4f
|
97 |
- Better Mako rendering exceptions via |
CM |
98 |
``pyramid.mako_templating.MakoRenderingException`` |
|
99 |
|
5c6963
|
100 |
- New request methods: ``current_route_url``, ``current_route_path``, and |
CM |
101 |
``static_path``. |
12cef0
|
102 |
|
5c6963
|
103 |
- New functions in ``pyramid.url``: ``current_route_path`` and |
CM |
104 |
``static_path``. |
12cef0
|
105 |
|
b8c797
|
106 |
- The ``pyramid.request.Request.static_url`` API (and its brethren |
CM |
107 |
``pyramid.request.Request.static_path``, ``pyramid.url.static_url``, and |
|
108 |
``pyramid.url.static_path``) now accept an asbolute filename as a "path" |
|
109 |
argument. This will generate a URL to an asset as long as the filename is |
|
110 |
in a directory which was previously registered as a static view. |
|
111 |
Previously, trying to generate a URL to an asset using an absolute file |
|
112 |
path would raise a ValueError. |
|
113 |
|
449287
|
114 |
- The ``RemoteUserAuthenticationPolicy ``, ``AuthTktAuthenticationPolicy``, |
CM |
115 |
and ``SessionAuthenticationPolicy`` constructors now accept an additional |
|
116 |
keyword argument named ``debug``. By default, this keyword argument is |
|
117 |
``False``. When it is ``True``, debug information will be sent to the |
|
118 |
Pyramid debug logger (usually on stderr) when the ``authenticated_userid`` |
|
119 |
or ``effective_principals`` method is called on any of these policies. The |
|
120 |
output produced can be useful when trying to diagnose |
|
121 |
authentication-related problems. |
|
122 |
|
141f90
|
123 |
- New view predicate: ``match_param``. Example: a view added via |
CM |
124 |
``config.add_view(aview, match_param='action=edit')`` will be called only |
|
125 |
when the ``request.matchdict`` has a value inside it named ``action`` with |
|
126 |
a value of ``edit``. |
|
127 |
|
6b2a62
|
128 |
Internal |
CM |
129 |
-------- |
|
130 |
|
|
131 |
- The Pyramid "exception view" machinery is now implemented as a "tween" |
|
132 |
(``pyramid.tweens.excview_tween_factory``). |
95a379
|
133 |
|
85093d
|
134 |
- WSGIHTTPException (HTTPFound, HTTPNotFound, etc) now has a new API named |
CM |
135 |
"prepare" which renders the body and content type when it is provided with |
|
136 |
a WSGI environ. Required for debug toolbar. |
|
137 |
|
|
138 |
- Once ``__call__`` or ``prepare`` is called on a WSGIHTTPException, the body |
|
139 |
will be set, and subsequent calls to ``__call__`` will always return the |
|
140 |
same body. Delete the body attribute to rerender the exception body. |
|
141 |
|
5c52da
|
142 |
- Previously the ``pyramid.events.BeforeRender`` event *wrapped* a dictionary |
CM |
143 |
(it addressed it as its ``_system`` attribute). Now it *is* a dictionary |
|
144 |
(it inherits from ``dict``), and it's the value that is passed to templates |
|
145 |
as a top-level dictionary. |
|
146 |
|
fb90f0
|
147 |
- The ``route_url``, ``route_path``, ``resource_url``, ``static_url``, and |
CM |
148 |
``current_route_url`` functions in the ``pyramid.url`` package now delegate |
|
149 |
to a method on the request they've been passed, instead of the other way |
|
150 |
around. The pyramid.request.Request object now inherits from a mixin named |
|
151 |
pyramid.url.URLMethodsMixin to make this possible, and all url/path |
|
152 |
generation logic is embedded in this mixin. |
|
153 |
|
5bf23f
|
154 |
- Refactor ``pyramid.config`` into a package. |
CM |
155 |
|
66da9b
|
156 |
- Removed the ``_set_security_policies`` method of the Configurator. |
CM |
157 |
|
53d9d4
|
158 |
- Moved the ``StaticURLInfo`` class from ``pyramid.static`` to |
CM |
159 |
``pyramid.config.views``. |
|
160 |
|
5f5a7e
|
161 |
- Move the ``Settings`` class from ``pyramid.settings`` to |
CM |
162 |
``pyramid.config.settings``. |
|
163 |
|
6da017
|
164 |
- Move the ``OverrideProvider``, ``PackageOverrides``, ``DirectoryOverride``, |
CM |
165 |
and ``FileOverride`` classes from ``pyramid.asset`` to |
|
166 |
``pyramid.config.assets``. |
|
167 |
|
ef6f6b
|
168 |
Deprecations |
CM |
169 |
------------ |
|
170 |
|
|
171 |
- All Pyramid-related deployment settings (e.g. ``debug_all``, |
|
172 |
``debug_notfound``) are now meant to be prefixed with the prefix |
|
173 |
``pyramid.``. For example: ``debug_all`` -> ``pyramid.debug_all``. The |
|
174 |
old non-prefixed settings will continue to work indefinitely but supplying |
53d9d4
|
175 |
them may eventually print a deprecation warning. All scaffolds and |
CM |
176 |
tutorials have been changed to use prefixed settings. |
ef6f6b
|
177 |
|
b5ffe3
|
178 |
- The ``settings`` dictionary now raises a deprecation warning when you |
CM |
179 |
attempt to access its values via ``__getattr__`` instead of |
|
180 |
via ``__getitem__``. |
|
181 |
|
3a8054
|
182 |
Backwards Incompatibilities |
CM |
183 |
--------------------------- |
|
184 |
|
|
185 |
- If a string is passed as the ``debug_logger`` parameter to a Configurator, |
|
186 |
that string is considered to be the name of a global Python logger rather |
|
187 |
than a dotted name to an instance of a logger. |
|
188 |
|
83bf91
|
189 |
- The ``pyramid.config.Configurator.include`` method now accepts only a |
CM |
190 |
single ``callable`` argument (a sequence of callables used to be |
|
191 |
permitted). If you are passing more than one ``callable`` to |
|
192 |
``pyramid.config.Configurator.include``, it will break. You now must now |
53d9d4
|
193 |
instead make a separate call to the method for each callable. This change |
CM |
194 |
was introduced to support the ``route_prefix`` feature of include. |
83bf91
|
195 |
|
04b7ea
|
196 |
- It may be necessary to more strictly order configuration route and view |
CM |
197 |
statements when using an "autocommitting" Configurator. In the past, it |
|
198 |
was possible to add a view which named a route name before adding a route |
|
199 |
with that name when you used an autocommitting configurator. For example:: |
|
200 |
|
|
201 |
config = Configurator(autocommit=True) |
|
202 |
config.add_view('my.pkg.someview', route_name='foo') |
|
203 |
config.add_route('foo', '/foo') |
|
204 |
|
|
205 |
The above will raise an exception when the view attempts to add itself. |
|
206 |
Now you must add the route before adding the view:: |
|
207 |
|
|
208 |
config = Configurator(autocommit=True) |
|
209 |
config.add_route('foo', '/foo') |
|
210 |
config.add_view('my.pkg.someview', route_name='foo') |
|
211 |
|
|
212 |
This won't effect "normal" users, only people who have legacy BFG codebases |
|
213 |
that used an autommitting configurator and possibly tests that use the |
|
214 |
configurator API (the configurator returned by ``pyramid.testing.setUp`` is |
|
215 |
an autocommitting configurator). The right way to get around this is to |
|
216 |
use a non-autocommitting configurator (the default), which does not have |
|
217 |
these directive ordering requirements. |
|
218 |
|
|
219 |
- The ``pyramid.config.Configurator.add_route`` directive no longer returns a |
|
220 |
route object. This change was required to make route vs. view |
|
221 |
configuration processing work properly. |
|
222 |
|
6b2a62
|
223 |
Documentation |
CM |
224 |
------------- |
|
225 |
|
fb90f0
|
226 |
- Narrative and API documentation which used the ``route_url``, |
CM |
227 |
``route_path``, ``resource_url``, ``static_url``, and ``current_route_url`` |
|
228 |
functions in the ``pyramid.url`` package have now been changed to use |
|
229 |
eponymous methods of the request instead. |
|
230 |
|
83bf91
|
231 |
- Added a section entitled "Using a Route Prefix to Compose Applications" to |
CM |
232 |
the "URL Dispatch" narrative documentation chapter. |
|
233 |
|
6b2a62
|
234 |
- Added a new module to the API docs: ``pyramid.tweens``. |
CM |
235 |
|
|
236 |
- Added a "Registering Tweens" section to the "Hooks" narrative chapter. |
|
237 |
|
|
238 |
- Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative |
|
239 |
chapter. |
|
240 |
|
473697
|
241 |
- Added documentation for the ``pyramid.tweens`` and ``pyramid.includes`` |
CM |
242 |
configuration settings to the "Environment Variables and ``.ini`` Files |
|
243 |
Settings" chapter. |
|
244 |
|
1ae7af
|
245 |
- Added a Logging chapter to the narrative docs (based on the Pylons logging |
CM |
246 |
docs, thanks Phil). |
|
247 |
|
53d9d4
|
248 |
- Added a Paste chapter to the narrative docs (moved content from the Project |
CM |
249 |
chapter). |
|
250 |
|
5c52da
|
251 |
- Added the ``pyramid.interfaces.IDict`` interface representing the methods |
CM |
252 |
of a dictionary, for documentation purposes only (IMultiDict and |
|
253 |
IBeforeRender inherit from it). |
|
254 |
|
42d31c
|
255 |
- All tutorials now use - The ``route_url``, ``route_path``, |
CM |
256 |
``resource_url``, ``static_url``, and ``current_route_url`` methods of the |
|
257 |
request rather than the function variants imported from ``pyramid.url``. |
|
258 |
|
b25335
|
259 |
- The ZODB wiki tutorial now uses the ``pyramid_zodbconn`` package rather |
CM |
260 |
than the ``repoze.zodbconn`` package to provide ZODB integration. |
|
261 |
|
eef972
|
262 |
Dependency Changes |
CM |
263 |
------------------ |
|
264 |
|
|
265 |
- Pyramid now relies on PasteScript >= 1.7.4. This version contains a |
|
266 |
feature important for allowing flexible logging configuration. |
|
267 |
|
391402
|
268 |
Scaffolds |
CM |
269 |
---------- |
|
270 |
|
|
271 |
- All scaffolds now use the ``pyramid_tm`` package rather than the |
|
272 |
``repoze.tm2`` middleware to manage transaction management. |
|
273 |
|
b25335
|
274 |
- The ZODB scaffold now uses the ``pyramid_zodbconn`` package rather than the |
CM |
275 |
``repoze.zodbconn`` package to provide ZODB integration. |
|
276 |
|
391402
|
277 |
- All scaffolds now use the ``pyramid_debugtoolbar`` package rather than the |
CM |
278 |
``WebError`` package to provide interactive debugging features. |
|
279 |
|
|
280 |
- Projects created via a scaffold no longer depend on the ``WebError`` |
|
281 |
package at all; configuration in the ``production.ini`` file which used to |
|
282 |
require its ``error_catcher`` middleware has been removed. Configuring |
|
283 |
error catching / email sending is now the domain of the ``pyramid_exclog`` |
|
284 |
package (see https://docs.pylonsproject.org/projects/pyramid_exclog/dev/). |
|
285 |
|
1939d0
|
286 |
Bug Fixes |
CM |
287 |
--------- |
|
288 |
|
|
289 |
- Fixed an issue with the default renderer not working at certain times. See |
|
290 |
https://github.com/Pylons/pyramid/issues/249 |
|
291 |
|