commit | author | age
|
b38bbf
|
1 |
1.8 (2017-01-21) |
MM |
2 |
================ |
|
3 |
|
|
4 |
- No major changes from 1.8b1. |
|
5 |
|
|
6 |
1.8b1 (2017-01-17) |
|
7 |
================== |
|
8 |
|
|
9 |
Features |
|
10 |
-------- |
|
11 |
|
|
12 |
- Added an ``override`` option to ``config.add_translation_dirs`` to allow |
|
13 |
later calls to place translation directories at a higher priority than |
|
14 |
earlier calls. See https://github.com/Pylons/pyramid/pull/2902 |
|
15 |
|
|
16 |
Documentation Changes |
|
17 |
--------------------- |
|
18 |
|
|
19 |
- Improve registry documentation to discuss uses as a component registry |
|
20 |
and as a dictionary. See https://github.com/Pylons/pyramid/pull/2893 |
|
21 |
|
|
22 |
- Quick Tour, Quick Tutorial, and most other remaining documentation updated to |
|
23 |
use cookiecutters instead of pcreate and scaffolds. |
|
24 |
See https://github.com/Pylons/pyramid/pull/2888 and |
|
25 |
https://github.com/Pylons/pyramid/pull/2889 |
|
26 |
|
|
27 |
- Fix unittests in wiki2 to work without different dependencies between |
|
28 |
py2 and py3. See https://github.com/Pylons/pyramid/pull/2899 |
|
29 |
|
|
30 |
- Update Windows documentation to track newer Python 3 improvements to the |
|
31 |
installer. See https://github.com/Pylons/pyramid/pull/2900 |
|
32 |
|
|
33 |
- Updated the ``mod_wsgi`` tutorial to use cookiecutters and Apache 2.4+. |
|
34 |
See https://github.com/Pylons/pyramid/pull/2901 |
|
35 |
|
|
36 |
1.8a1 (2016-12-25) |
|
37 |
================== |
|
38 |
|
|
39 |
Backward Incompatibilities |
|
40 |
-------------------------- |
|
41 |
|
|
42 |
- Support for the ``IContextURL`` interface that was deprecated in Pyramid 1.3 |
|
43 |
has been removed. See https://github.com/Pylons/pyramid/pull/2822 |
|
44 |
|
|
45 |
- Following the Pyramid deprecation period (1.6 -> 1.8), |
|
46 |
daemon support for pserve has been removed. This includes removing the |
|
47 |
daemon commands (start, stop, restart, status) as well as the following |
|
48 |
arguments: ``--daemon``, ``--pid-file``, ``--log-file``, |
|
49 |
``--monitor-restart``, ``--status``, ``--user``, ``--group``, |
|
50 |
``--stop-daemon`` |
|
51 |
|
|
52 |
To run your server as a daemon you should use a process manager instead of |
|
53 |
pserve. |
|
54 |
|
|
55 |
See https://github.com/Pylons/pyramid/pull/2615 |
|
56 |
|
|
57 |
- ``pcreate`` is now interactive by default. You will be prompted if a file |
|
58 |
already exists with different content. Previously if there were similar |
|
59 |
files it would silently skip them unless you specified ``--interactive`` |
|
60 |
or ``--overwrite``. |
|
61 |
See https://github.com/Pylons/pyramid/pull/2775 |
|
62 |
|
|
63 |
- Removed undocumented argument ``cachebust_match`` from |
|
64 |
``pyramid.static.static_view``. This argument was shipped accidentally |
|
65 |
in Pyramid 1.6. See https://github.com/Pylons/pyramid/pull/2681 |
|
66 |
|
|
67 |
- Change static view to avoid setting the ``Content-Encoding`` response header |
|
68 |
to an encoding guessed using Python's ``mimetypes`` module. This was causing |
|
69 |
clients to decode the content of gzipped files when downloading them. The |
|
70 |
client would end up with a ``foo.txt.gz`` file on disk that was already |
|
71 |
decoded, thus should really be ``foo.txt``. Also, the ``Content-Encoding`` |
|
72 |
should only have been used if the client itself broadcast support for the |
|
73 |
encoding via ``Accept-Encoding`` request headers. |
|
74 |
See https://github.com/Pylons/pyramid/pull/2810 |
|
75 |
|
|
76 |
- Settings are no longer accessible as attributes on the settings object |
|
77 |
(e.g. ``request.registry.settings.foo``). This was deprecated in Pyramid 1.2. |
|
78 |
See https://github.com/Pylons/pyramid/pull/2823 |
|
79 |
|
|
80 |
Features |
|
81 |
-------- |
|
82 |
|
|
83 |
- Python 3.6 compatibility. |
|
84 |
https://github.com/Pylons/pyramid/issues/2835 |
|
85 |
|
|
86 |
- ``pcreate`` learned about ``--package-name`` to allow you to create a new |
|
87 |
project in an existing folder with a different package name than the project |
|
88 |
name. See https://github.com/Pylons/pyramid/pull/2783 |
|
89 |
|
|
90 |
- The ``_get_credentials`` private method of ``BasicAuthAuthenticationPolicy`` |
|
91 |
has been extracted into standalone function ``extract_http_basic_credentials`` |
|
92 |
in ``pyramid.authentication`` module, this function extracts HTTP Basic |
|
93 |
credentials from a ``request`` object, and returns them as a named tuple. |
|
94 |
See https://github.com/Pylons/pyramid/pull/2662 |
|
95 |
|
|
96 |
- Pyramid 1.4 silently dropped a feature of the configurator that has been |
|
97 |
restored. It's again possible for action discriminators to conflict across |
|
98 |
different action orders. |
|
99 |
See https://github.com/Pylons/pyramid/pull/2757 |
|
100 |
|
|
101 |
- ``pyramid.paster.bootstrap`` and its sibling ``pyramid.scripting.prepare`` |
|
102 |
can now be used as context managers to automatically invoke the ``closer`` |
|
103 |
and pop threadlocals off of the stack to prevent memory leaks. |
|
104 |
See https://github.com/Pylons/pyramid/pull/2760 |
|
105 |
|
|
106 |
- Added ``pyramid.config.Configurator.add_exception_view`` and the |
|
107 |
``pyramid.view.exception_view_config`` decorator. It is now possible using |
|
108 |
these methods or via the new ``exception_only=True`` option to ``add_view`` |
|
109 |
to add a view which will only be matched when handling an exception. |
|
110 |
Previously any exception views were also registered for a traversal |
|
111 |
context that inherited from the exception class which prevented any |
|
112 |
exception-only optimizations. |
|
113 |
See https://github.com/Pylons/pyramid/pull/2660 |
|
114 |
|
|
115 |
- Added the ``exception_only`` boolean to |
|
116 |
``pyramid.interfaces.IViewDeriverInfo`` which can be used by view derivers |
|
117 |
to determine if they are wrapping a view which only handles exceptions. |
|
118 |
This means that it is no longer necessary to perform request-time checks |
|
119 |
for ``request.exception`` to determine if the view is handling an exception |
|
120 |
- the pipeline can be optimized at config-time. |
|
121 |
See https://github.com/Pylons/pyramid/pull/2660 |
|
122 |
|
|
123 |
- ``pserve`` should now work with ``gevent`` and other workers that need |
|
124 |
to monkeypatch the process, assuming the server and / or the app do so |
|
125 |
as soon as possible before importing the rest of pyramid. |
|
126 |
See https://github.com/Pylons/pyramid/pull/2797 |
|
127 |
|
|
128 |
- Pyramid no longer copies the settings object passed to the |
|
129 |
``pyramid.config.Configurator(settings=)``. The original ``dict`` is kept. |
|
130 |
See https://github.com/Pylons/pyramid/pull/2823 |
|
131 |
|
|
132 |
- The csrf trusted origins setting may now be a whitespace-separated list of |
|
133 |
domains. Previously only a python list was allowed. Also, it can now be set |
|
134 |
using the ``PYRAMID_CSRF_TRUSTED_ORIGINS`` environment variable similar to |
|
135 |
other settings. See https://github.com/Pylons/pyramid/pull/2823 |
|
136 |
|
|
137 |
- ``pserve --reload`` now uses the |
|
138 |
`hupper <http://docs.pylonsproject.org/projects/hupper/en/latest/>` |
|
139 |
library to monitor file changes. This comes with many improvements: |
|
140 |
|
|
141 |
- If the `watchdog <http://pythonhosted.org/watchdog/>`_ package is |
|
142 |
installed then monitoring will be done using inotify instead of |
|
143 |
cpu and disk-intensive polling. |
|
144 |
|
|
145 |
- The monitor is now a separate process that will not crash and starts up |
|
146 |
before any of your code. |
|
147 |
|
|
148 |
- The monitor will not restart the process after a crash until a file is |
|
149 |
saved. |
|
150 |
|
|
151 |
- The monitor works on windows. |
|
152 |
|
|
153 |
- You can now trigger a reload manually from a pyramid view or any other |
|
154 |
code via ``hupper.get_reloader().trigger_reload()``. Kind of neat. |
|
155 |
|
|
156 |
- You can trigger a reload by issuing a ``SIGHUP`` to the monitor process. |
|
157 |
|
|
158 |
See https://github.com/Pylons/pyramid/pull/2805 |
|
159 |
|
|
160 |
- A new ``[pserve]`` section is supported in your config files with a |
|
161 |
``watch_files`` key that can configure ``pserve --reload`` to monitor custom |
|
162 |
file paths. See https://github.com/Pylons/pyramid/pull/2827 |
|
163 |
|
|
164 |
- Allow streaming responses to be made from subclasses of |
|
165 |
``pyramid.httpexceptions.HTTPException``. Previously the response would |
|
166 |
be unrolled while testing for a body, making it impossible to stream |
|
167 |
a response. |
|
168 |
See https://github.com/Pylons/pyramid/pull/2863 |
|
169 |
|
|
170 |
- Update starter, alchemy and zodb scaffolds to support IPv6 by using the |
|
171 |
new ``listen`` directives in waitress. |
|
172 |
See https://github.com/Pylons/pyramid/pull/2853 |
|
173 |
|
|
174 |
- All p* scripts now use argparse instead of optparse. This improves their |
|
175 |
``--help`` output as well as enabling nicer documentation of their options. |
|
176 |
See https://github.com/Pylons/pyramid/pull/2864 |
|
177 |
|
|
178 |
- Any deferred configuration action registered via ``config.action`` may now |
|
179 |
depend on threadlocal state, such as asset overrides, being active when |
|
180 |
the action is executed. |
|
181 |
See https://github.com/Pylons/pyramid/pull/2873 |
|
182 |
|
|
183 |
- Asset specifications for directories passed to |
|
184 |
``config.add_translation_dirs`` now support overriding the entire asset |
|
185 |
specification, including the folder name. Previously only the package name |
|
186 |
was supported and the folder would always need to have the same name. |
|
187 |
See https://github.com/Pylons/pyramid/pull/2873 |
|
188 |
|
|
189 |
- ``config.begin()`` will propagate the current threadlocal request through |
|
190 |
as long as the registry is the same. For example: |
|
191 |
|
|
192 |
.. code-block:: python |
|
193 |
|
|
194 |
request = Request.blank(...) |
|
195 |
config.begin(request) # pushes a request |
|
196 |
config.begin() # propagates the previous request through unchanged |
|
197 |
assert get_current_request() is request |
|
198 |
|
|
199 |
See https://github.com/Pylons/pyramid/pull/2873 |
|
200 |
|
66585f
|
201 |
- Added a new ``callback`` option to ``config.set_default_csrf_options`` which |
MM |
202 |
can be used to determine per-request whether CSRF checking should be enabled |
|
203 |
to allow for a mix authentication methods. Only cookie-based methods |
|
204 |
generally require CSRF checking. |
|
205 |
See https://github.com/Pylons/pyramid/pull/2778 |
|
206 |
|
b38bbf
|
207 |
Bug Fixes |
MM |
208 |
--------- |
|
209 |
|
|
210 |
- Fixed bug in ``proutes`` such that it now shows the correct view when a |
|
211 |
class and ``attr`` is involved. |
|
212 |
See: https://github.com/Pylons/pyramid/pull/2687 |
|
213 |
|
|
214 |
- Fix a ``FutureWarning`` in Python 3.5 when using ``re.split`` on the |
|
215 |
``format`` setting to the ``proutes`` script. |
|
216 |
See https://github.com/Pylons/pyramid/pull/2714 |
|
217 |
|
|
218 |
- Fix a ``RuntimeWarning`` emitted by WebOb when using arbitrary objects |
|
219 |
as the ``userid`` in the ``AuthTktAuthenticationPolicy``. This is now caught |
|
220 |
by the policy and the object is serialized as a base64 string to avoid |
|
221 |
the cryptic warning. Since the userid will be read back as a string on |
|
222 |
subsequent requests a more useful warning is emitted encouraging you to |
|
223 |
use a primitive type instead. |
|
224 |
See https://github.com/Pylons/pyramid/pull/2715 |
|
225 |
|
|
226 |
- Pyramid 1.6 introduced the ability for an action to invoke another action. |
|
227 |
There was a bug in the way that ``config.add_view`` would interact with |
|
228 |
custom view derivers introduced in Pyramid 1.7 because the view's |
|
229 |
discriminator cannot be computed until view derivers and view predicates |
|
230 |
have been created in earlier orders. Invoking an action from another action |
|
231 |
would trigger an unrolling of the pipeline and would compute discriminators |
|
232 |
before they were ready. The new behavior respects the ``order`` of the action |
|
233 |
and ensures the discriminators are not computed until dependent actions |
|
234 |
from previous orders have executed. |
|
235 |
See https://github.com/Pylons/pyramid/pull/2757 |
|
236 |
|
|
237 |
- Fix bug in i18n where the default domain would always use the Germanic plural |
|
238 |
style, even if a different plural function is defined in the relevant |
|
239 |
messages file. See https://github.com/Pylons/pyramid/pull/2859 |
|
240 |
|
|
241 |
- The ``config.override_asset`` method now occurs during |
|
242 |
``pyramid.config.PHASE1_CONFIG`` such that it is ordered to execute before |
|
243 |
any calls to ``config.add_translation_dirs``. |
|
244 |
See https://github.com/Pylons/pyramid/pull/2873 |
|
245 |
|
|
246 |
Deprecations |
|
247 |
------------ |
|
248 |
|
|
249 |
- The ``pcreate`` script and related scaffolds have been deprecated in favor |
|
250 |
of the popular |
|
251 |
`cookiecutter <https://cookiecutter.readthedocs.io/en/latest/>`_ project. |
|
252 |
|
|
253 |
All of Pyramid's official scaffolds as well as the tutorials have been |
|
254 |
ported to cookiecutters: |
|
255 |
|
|
256 |
- `pyramid-cookiecutter-starter |
|
257 |
<https://github.com/Pylons/pyramid-cookiecutter-starter>`_ |
|
258 |
|
|
259 |
- `pyramid-cookiecutter-alchemy |
|
260 |
<https://github.com/Pylons/pyramid-cookiecutter-alchemy>`_ |
|
261 |
|
|
262 |
- `pyramid-cookiecutter-zodb |
|
263 |
<https://github.com/Pylons/pyramid-cookiecutter-zodb>`_ |
|
264 |
|
|
265 |
See https://github.com/Pylons/pyramid/pull/2780 |
|
266 |
|
|
267 |
Documentation Changes |
|
268 |
--------------------- |
|
269 |
|
|
270 |
- Update Typographical Conventions. |
|
271 |
https://github.com/Pylons/pyramid/pull/2838 |
|
272 |
|
|
273 |
- Add `pyramid_nacl_session |
|
274 |
<http://docs.pylonsproject.org/projects/pyramid-nacl-session/en/latest/>`_ |
|
275 |
to session factories. See https://github.com/Pylons/pyramid/issues/2791 |
|
276 |
|
|
277 |
- Update ``HACKING.txt`` from stale branch that was never merged to master. |
|
278 |
See https://github.com/Pylons/pyramid/pull/2782 |
|
279 |
|
|
280 |
- Updated Windows installation instructions and related bits. |
|
281 |
See https://github.com/Pylons/pyramid/issues/2661 |
|
282 |
|
|
283 |
- Fix an inconsistency in the documentation between view predicates and |
|
284 |
route predicates and highlight the differences in their APIs. |
|
285 |
See https://github.com/Pylons/pyramid/pull/2764 |
|
286 |
|
|
287 |
- Clarify a possible misuse of the ``headers`` kwarg to subclasses of |
|
288 |
``pyramid.httpexceptions.HTTPException`` in which more appropriate |
|
289 |
kwargs from the parent class ``pyramid.response.Response`` should be |
|
290 |
used instead. See https://github.com/Pylons/pyramid/pull/2750 |
|
291 |
|
|
292 |
- The SQLAlchemy + URL Dispatch + Jinja2 (``wiki2``) and |
|
293 |
ZODB + Traversal + Chameleon (``wiki``) tutorials have been updated to |
|
294 |
utilize the new cookiecutters and drop support for the ``pcreate`` |
|
295 |
scaffolds. |
|
296 |
|
|
297 |
See https://github.com/Pylons/pyramid/pull/2881 and |
|
298 |
https://github.com/Pylons/pyramid/pull/2883. |
|
299 |
|
|
300 |
- Improve output of p* script descriptions for help. |
|
301 |
See https://github.com/Pylons/pyramid/pull/2886 |
|
302 |
|
|
303 |
- Quick Tour updated to use cookiecutters instead of pcreate and scaffolds. |
|
304 |
See https://github.com/Pylons/pyramid/pull/2888 |
|
305 |
|
f038c7
|
306 |
1.7 (2016-05-19) |
MM |
307 |
================ |
|
308 |
|
|
309 |
- Fix a bug in the wiki2 tutorial where bcrypt is always expecting byte |
|
310 |
strings. See https://github.com/Pylons/pyramid/pull/2576 |
|
311 |
|
|
312 |
- Simplify windows detection code and remove some duplicated data. |
|
313 |
See https://github.com/Pylons/pyramid/pull/2585 and |
|
314 |
https://github.com/Pylons/pyramid/pull/2586 |
|
315 |
|
|
316 |
1.7b4 (2016-05-12) |
|
317 |
================== |
|
318 |
|
|
319 |
- Fixed the exception view tween to re-raise the original exception if |
|
320 |
no exception view could be found to handle the exception. This better |
|
321 |
allows tweens further up the chain to handle exceptions that were |
|
322 |
left unhandled. Previously they would be converted into a |
|
323 |
``PredicateMismatch`` exception if predicates failed to allow the view to |
|
324 |
handle the exception. |
|
325 |
See https://github.com/Pylons/pyramid/pull/2567 |
|
326 |
|
|
327 |
- Exposed the ``pyramid.interfaces.IRequestFactory`` interface to mirror |
|
328 |
the public ``pyramid.interfaces.IResponseFactory`` interface. |
|
329 |
|
|
330 |
1.7b3 (2016-05-10) |
|
331 |
================== |
|
332 |
|
|
333 |
- Fix ``request.invoke_exception_view`` to raise an ``HTTPNotFound`` |
|
334 |
exception if no view is matched. Previously ``None`` would be returned |
|
335 |
if no views were matched and a ``PredicateMismatch`` would be raised if |
|
336 |
a view "almost" matched (a view was found matching the context). |
|
337 |
See https://github.com/Pylons/pyramid/pull/2564 |
|
338 |
|
|
339 |
- Add defaults for py.test configuration and coverage to all three scaffolds, |
|
340 |
and update documentation accordingly. |
|
341 |
See https://github.com/Pylons/pyramid/pull/2550 |
|
342 |
|
|
343 |
- Add ``linkcheck`` to ``Makefile`` for Sphinx. To check the documentation for |
|
344 |
broken links, use the command ``make linkcheck |
|
345 |
SPHINXBUILD=$VENV/bin/sphinx-build``. Also removed and fixed dozens of broken |
|
346 |
external links. |
|
347 |
|
|
348 |
- Fix the internal runner for scaffold tests to ensure they work with pip |
|
349 |
and py.test. |
|
350 |
See https://github.com/Pylons/pyramid/pull/2565 |
|
351 |
|
|
352 |
1.7b2 (2016-05-01) |
|
353 |
================== |
|
354 |
|
|
355 |
- Removed inclusion of pyramid_tm in development.ini for alchemy scaffold |
|
356 |
See https://github.com/Pylons/pyramid/issues/2538 |
|
357 |
|
|
358 |
- A default permission set via ``config.set_default_permission`` will no |
|
359 |
longer be enforced on an exception view. This has been the case for a while |
|
360 |
with the default exception views (``config.add_notfound_view`` and |
|
361 |
``config.add_forbidden_view``), however for any other exception view a |
|
362 |
developer had to remember to set ``permission=NO_PERMISSION_REQUIRED`` or |
|
363 |
be surprised when things didn't work. It is still possible to force a |
|
364 |
permission check on an exception view by setting the ``permission`` argument |
|
365 |
manually to ``config.add_view``. This behavior is consistent with the new |
|
366 |
CSRF features added in the 1.7 series. |
|
367 |
See https://github.com/Pylons/pyramid/pull/2534 |
|
368 |
|
|
369 |
1.7b1 (2016-04-25) |
|
370 |
================== |
|
371 |
|
|
372 |
- This release announces the beta period for 1.7. |
|
373 |
|
|
374 |
- Fix an issue where some files were being included in the alchemy scafffold |
|
375 |
which had been removed from the 1.7 series. |
|
376 |
See https://github.com/Pylons/pyramid/issues/2525 |
|
377 |
|
|
378 |
1.7a2 (2016-04-19) |
|
379 |
================== |
|
380 |
|
|
381 |
Features |
|
382 |
-------- |
|
383 |
|
|
384 |
- Automatic CSRF checks are now disabled by default on exception views. They |
|
385 |
can be turned back on by setting the appropriate `require_csrf` option on |
|
386 |
the view. |
|
387 |
See https://github.com/Pylons/pyramid/pull/2517 |
|
388 |
|
|
389 |
- The automatic CSRF API was reworked to use a config directive for |
|
390 |
setting the options. The ``pyramid.require_default_csrf`` setting is |
|
391 |
no longer supported. Instead, a new ``config.set_default_csrf_options`` |
|
392 |
directive has been introduced that allows the developer to specify |
|
393 |
the default value for ``require_csrf`` as well as change the CSRF token, |
|
394 |
header and safe request methods. The ``pyramid.csrf_trusted_origins`` |
|
395 |
setting is still supported. |
|
396 |
See https://github.com/Pylons/pyramid/pull/2518 |
|
397 |
|
|
398 |
Bug fixes |
|
399 |
--------- |
|
400 |
|
|
401 |
- CSRF origin checks had a bug causing the checks to always fail. |
|
402 |
See https://github.com/Pylons/pyramid/pull/2512 |
|
403 |
|
|
404 |
- Fix the test suite to pass on windows. |
|
405 |
See https://github.com/Pylons/pyramid/pull/2520 |
|
406 |
|
d9c20d
|
407 |
1.7a1 (2016-04-16) |
MM |
408 |
================== |
|
409 |
|
|
410 |
Backward Incompatibilities |
|
411 |
-------------------------- |
|
412 |
|
|
413 |
- Following the Pyramid deprecation period (1.4 -> 1.6), |
|
414 |
AuthTktAuthenticationPolicy's default hashing algorithm is changing from md5 |
|
415 |
to sha512. If you are using the authentication policy and need to continue |
|
416 |
using md5, please explicitly set hashalg to 'md5'. |
|
417 |
|
|
418 |
This change does mean that any existing auth tickets (and associated cookies) |
|
419 |
will no longer be valid, and users will no longer be logged in, and have to |
|
420 |
login to their accounts again. |
|
421 |
|
|
422 |
See https://github.com/Pylons/pyramid/pull/2496 |
|
423 |
|
|
424 |
- The ``check_csrf_token`` function no longer validates a csrf token in the |
|
425 |
query string of a request. Only headers and request bodies are supported. |
|
426 |
See https://github.com/Pylons/pyramid/pull/2500 |
|
427 |
|
|
428 |
Features |
|
429 |
-------- |
|
430 |
|
|
431 |
- Added a new setting, ``pyramid.require_default_csrf`` which may be used |
|
432 |
to turn on CSRF checks globally for every POST request in the application. |
|
433 |
This should be considered a good default for websites built on Pyramid. |
|
434 |
It is possible to opt-out of CSRF checks on a per-view basis by setting |
|
435 |
``require_csrf=False`` on those views. |
|
436 |
See https://github.com/Pylons/pyramid/pull/2413 |
|
437 |
|
|
438 |
- Added a ``require_csrf`` view option which will enforce CSRF checks on any |
|
439 |
request with an unsafe method as defined by RFC2616. If the CSRF check fails |
|
440 |
a ``BadCSRFToken`` exception will be raised and may be caught by exception |
|
441 |
views (the default response is a ``400 Bad Request``). This option should be |
|
442 |
used in place of the deprecated ``check_csrf`` view predicate which would |
|
443 |
normally result in unexpected ``404 Not Found`` response to the client |
|
444 |
instead of a catchable exception. See |
|
445 |
https://github.com/Pylons/pyramid/pull/2413 and |
|
446 |
https://github.com/Pylons/pyramid/pull/2500 |
|
447 |
|
|
448 |
- Added an additional CSRF validation that checks the origin/referrer of a |
|
449 |
request and makes sure it matches the current ``request.domain``. This |
|
450 |
particular check is only active when accessing a site over HTTPS as otherwise |
|
451 |
browsers don't always send the required information. If this additional CSRF |
|
452 |
validation fails a ``BadCSRFOrigin`` exception will be raised and may be |
|
453 |
caught by exception views (the default response is ``400 Bad Request``). |
|
454 |
Additional allowed origins may be configured by setting |
|
455 |
``pyramid.csrf_trusted_origins`` to a list of domain names (with ports if on |
|
456 |
a non standard port) to allow. Subdomains are not allowed unless the domain |
|
457 |
name has been prefixed with a ``.``. See |
|
458 |
https://github.com/Pylons/pyramid/pull/2501 |
|
459 |
|
|
460 |
- Added a new ``pyramid.session.check_csrf_origin`` API for validating the |
|
461 |
origin or referrer headers against the request's domain. |
|
462 |
See https://github.com/Pylons/pyramid/pull/2501 |
|
463 |
|
|
464 |
- Pyramid HTTPExceptions will now take into account the best match for the |
|
465 |
clients Accept header, and depending on what is requested will return |
|
466 |
text/html, application/json or text/plain. The default for */* is still |
|
467 |
text/html, but if application/json is explicitly mentioned it will now |
|
468 |
receive a valid JSON response. See |
|
469 |
https://github.com/Pylons/pyramid/pull/2489 |
|
470 |
|
|
471 |
- A new event and interface (BeforeTraversal) has been introduced that will |
|
472 |
notify listeners before traversal starts in the router. See |
|
473 |
https://github.com/Pylons/pyramid/pull/2469 and |
|
474 |
https://github.com/Pylons/pyramid/pull/1876 |
|
475 |
|
|
476 |
- Add a new "view deriver" concept to Pyramid to allow framework authors to |
|
477 |
inject elements into the standard Pyramid view pipeline and affect all |
|
478 |
views in an application. This is similar to a decorator except that it |
|
479 |
has access to options passed to ``config.add_view`` and can affect other |
|
480 |
stages of the pipeline such as the raw response from a view or prior to |
|
481 |
security checks. See https://github.com/Pylons/pyramid/pull/2021 |
|
482 |
|
|
483 |
- Allow a leading ``=`` on the key of the request param predicate. |
|
484 |
For example, '=abc=1' is equivalent down to |
|
485 |
``request.params['=abc'] == '1'``. |
|
486 |
See https://github.com/Pylons/pyramid/pull/1370 |
|
487 |
|
|
488 |
- A new ``request.invoke_exception_view(...)`` method which can be used to |
|
489 |
invoke an exception view and get back a response. This is useful for |
|
490 |
rendering an exception view outside of the context of the excview tween |
|
491 |
where you may need more control over the request. |
|
492 |
See https://github.com/Pylons/pyramid/pull/2393 |
|
493 |
|
|
494 |
- Allow using variable substitutions like ``%(LOGGING_LOGGER_ROOT_LEVEL)s`` |
|
495 |
for logging sections of the .ini file and populate these variables from |
|
496 |
the ``pserve`` command line -- e.g.: |
|
497 |
``pserve development.ini LOGGING_LOGGER_ROOT_LEVEL=DEBUG`` |
|
498 |
See https://github.com/Pylons/pyramid/pull/2399 |
|
499 |
|
|
500 |
Documentation Changes |
|
501 |
--------------------- |
|
502 |
|
|
503 |
- A complete overhaul of the docs: |
|
504 |
|
|
505 |
- Use pip instead of easy_install. |
|
506 |
- Become opinionated by preferring Python 3.4 or greater to simplify |
|
507 |
installation of Python and its required packaging tools. |
|
508 |
- Use venv for the tool, and virtual environment for the thing created, |
|
509 |
instead of virtualenv. |
|
510 |
- Use py.test and pytest-cov instead of nose and coverage. |
|
511 |
- Further updates to the scaffolds as well as tutorials and their src files. |
|
512 |
|
|
513 |
See https://github.com/Pylons/pyramid/pull/2468 |
|
514 |
|
|
515 |
- A complete overhaul of the ``alchemy`` scaffold as well as the |
|
516 |
Wiki2 SQLAlchemy + URLDispatch tutorial to introduce more modern features |
|
517 |
into the usage of SQLAlchemy with Pyramid and provide a better starting |
|
518 |
point for new projects. |
|
519 |
See https://github.com/Pylons/pyramid/pull/2024 |
|
520 |
|
|
521 |
Bug Fixes |
|
522 |
--------- |
|
523 |
|
|
524 |
- Fix ``pserve --browser`` to use the ``--server-name`` instead of the |
|
525 |
app name when selecting a section to use. This was only working for people |
|
526 |
who had server and app sections with the same name, for example |
|
527 |
``[app:main]`` and ``[server:main]``. |
|
528 |
See https://github.com/Pylons/pyramid/pull/2292 |
|
529 |
|
|
530 |
Deprecations |
|
531 |
------------ |
|
532 |
|
|
533 |
- The ``check_csrf`` view predicate has been deprecated. Use the |
|
534 |
new ``require_csrf`` option or the ``pyramid.require_default_csrf`` setting |
|
535 |
to ensure that the ``BadCSRFToken`` exception is raised. |
|
536 |
See https://github.com/Pylons/pyramid/pull/2413 |
|
537 |
|
|
538 |
- Support for Python 3.3 will be removed in Pyramid 1.8. |
|
539 |
https://github.com/Pylons/pyramid/issues/2477 |
|
540 |
|
|
541 |
- Python 2.6 is no longer supported by Pyramid. See |
|
542 |
https://github.com/Pylons/pyramid/issues/2368 |
|
543 |
|
|
544 |
- Dropped Python 3.2 support. |
|
545 |
See https://github.com/Pylons/pyramid/pull/2256 |
|
546 |
|
53356f
|
547 |
1.6 (2016-01-03) |
MM |
548 |
================ |
|
549 |
|
|
550 |
Deprecations |
|
551 |
------------ |
|
552 |
|
|
553 |
- Continue removal of ``pserve`` daemon/process management features |
|
554 |
by deprecating ``--user`` and ``--group`` options. |
|
555 |
See https://github.com/Pylons/pyramid/pull/2190 |
|
556 |
|
|
557 |
1.6b3 (2015-12-17) |
|
558 |
================== |
|
559 |
|
|
560 |
Backward Incompatibilities |
|
561 |
-------------------------- |
|
562 |
|
|
563 |
- Remove the ``cachebust`` option from ``config.add_static_view``. See |
|
564 |
``config.add_cache_buster`` for the new way to attach cache busters to |
|
565 |
static assets. |
|
566 |
See https://github.com/Pylons/pyramid/pull/2186 |
|
567 |
|
|
568 |
- Modify the ``pyramid.interfaces.ICacheBuster`` API to be a simple callable |
|
569 |
instead of an object with ``match`` and ``pregenerate`` methods. Cache |
|
570 |
busters are now focused solely on generation. Matching has been dropped. |
|
571 |
|
|
572 |
Note this affects usage of ``pyramid.static.QueryStringCacheBuster`` and |
|
573 |
``pyramid.static.ManifestCacheBuster``. |
|
574 |
|
|
575 |
See https://github.com/Pylons/pyramid/pull/2186 |
|
576 |
|
|
577 |
Features |
|
578 |
-------- |
|
579 |
|
|
580 |
- Add a new ``config.add_cache_buster`` API for attaching cache busters to |
|
581 |
static assets. See https://github.com/Pylons/pyramid/pull/2186 |
|
582 |
|
|
583 |
Bug Fixes |
|
584 |
--------- |
|
585 |
|
|
586 |
- Ensure that ``IAssetDescriptor.abspath`` always returns an absolute path. |
|
587 |
There were cases depending on the process CWD that a relative path would |
|
588 |
be returned. See https://github.com/Pylons/pyramid/issues/2188 |
|
589 |
|
|
590 |
1.6b2 (2015-10-15) |
|
591 |
================== |
|
592 |
|
|
593 |
Features |
|
594 |
-------- |
|
595 |
|
|
596 |
- Allow asset specifications to be supplied to |
|
597 |
``pyramid.static.ManifestCacheBuster`` instead of requiring a |
|
598 |
filesystem path. |
|
599 |
|
|
600 |
1.6b1 (2015-10-15) |
|
601 |
================== |
|
602 |
|
|
603 |
Backward Incompatibilities |
|
604 |
-------------------------- |
|
605 |
|
|
606 |
- IPython and BPython support have been removed from pshell in the core. |
|
607 |
To continue using them on Pyramid 1.6+ you must install the binding |
|
608 |
packages explicitly:: |
|
609 |
|
|
610 |
$ pip install pyramid_ipython |
|
611 |
|
|
612 |
or |
|
613 |
|
|
614 |
$ pip install pyramid_bpython |
|
615 |
|
|
616 |
- Remove default cache busters introduced in 1.6a1 including |
|
617 |
``PathSegmentCacheBuster``, ``PathSegmentMd5CacheBuster``, and |
|
618 |
``QueryStringMd5CacheBuster``. |
|
619 |
See https://github.com/Pylons/pyramid/pull/2116 |
|
620 |
|
|
621 |
Features |
|
622 |
-------- |
|
623 |
|
|
624 |
- Additional shells for ``pshell`` can now be registered as entrypoints. See |
|
625 |
https://github.com/Pylons/pyramid/pull/1891 and |
|
626 |
https://github.com/Pylons/pyramid/pull/2012 |
|
627 |
|
|
628 |
- The variables injected into ``pshell`` are now displayed with their |
|
629 |
docstrings instead of the default ``str(obj)`` when possible. |
|
630 |
See https://github.com/Pylons/pyramid/pull/1929 |
|
631 |
|
|
632 |
- Add new ``pyramid.static.ManifestCacheBuster`` for use with external |
|
633 |
asset pipelines as well as examples of common usages in the narrative. |
|
634 |
See https://github.com/Pylons/pyramid/pull/2116 |
|
635 |
|
|
636 |
- Fix ``pserve --reload`` to not crash on syntax errors!!! |
|
637 |
See https://github.com/Pylons/pyramid/pull/2125 |
|
638 |
|
|
639 |
- Fix an issue when user passes unparsed strings to ``pyramid.session.CookieSession`` |
|
640 |
and ``pyramid.authentication.AuthTktCookieHelper`` for time related parameters |
|
641 |
``timeout``, ``reissue_time``, ``max_age`` that expect an integer value. |
|
642 |
See https://github.com/Pylons/pyramid/pull/2050 |
|
643 |
|
|
644 |
Bug Fixes |
|
645 |
--------- |
|
646 |
|
|
647 |
- ``pyramid.httpexceptions.HTTPException`` now defaults to |
|
648 |
``520 Unknown Error`` instead of ``None None`` to conform with changes in |
|
649 |
WebOb 1.5. |
|
650 |
See https://github.com/Pylons/pyramid/pull/1865 |
|
651 |
|
|
652 |
- ``pshell`` will now preserve the capitalization of variables in the |
|
653 |
``[pshell]`` section of the INI file. This makes exposing classes to the |
|
654 |
shell a little more straightfoward. |
|
655 |
See https://github.com/Pylons/pyramid/pull/1883 |
|
656 |
|
|
657 |
- Fixed usage of ``pserve --monitor-restart --daemon`` which would fail in |
|
658 |
horrible ways. See https://github.com/Pylons/pyramid/pull/2118 |
|
659 |
|
|
660 |
- Explicitly prevent ``pserve --reload --daemon`` from being used. It's never |
|
661 |
been supported but would work and fail in weird ways. |
|
662 |
See https://github.com/Pylons/pyramid/pull/2119 |
|
663 |
|
|
664 |
- Fix an issue on Windows when running ``pserve --reload`` in which the |
|
665 |
process failed to fork because it could not find the pserve script to |
|
666 |
run. See https://github.com/Pylons/pyramid/pull/2138 |
|
667 |
|
|
668 |
Deprecations |
|
669 |
------------ |
|
670 |
|
|
671 |
- Deprecate ``pserve --monitor-restart`` in favor of user's using a real |
|
672 |
process manager such as Systemd or Upstart as well as Python-based |
|
673 |
solutions like Circus and Supervisor. |
|
674 |
See https://github.com/Pylons/pyramid/pull/2120 |
|
675 |
|
|
676 |
1.6a2 (2015-06-30) |
|
677 |
================== |
|
678 |
|
|
679 |
Bug Fixes |
|
680 |
--------- |
|
681 |
|
|
682 |
- Ensure that ``pyramid.httpexceptions.exception_response`` returns the |
|
683 |
appropriate "concrete" class for ``400`` and ``500`` status codes. |
|
684 |
See https://github.com/Pylons/pyramid/issues/1832 |
|
685 |
|
|
686 |
- Fix an infinite recursion bug introduced in 1.6a1 when |
|
687 |
``pyramid.view.render_view_to_response`` was called directly or indirectly. |
|
688 |
See https://github.com/Pylons/pyramid/issues/1643 |
|
689 |
|
|
690 |
- Further fix the JSONP renderer by prefixing the returned content with |
|
691 |
a comment. This should mitigate attacks from Flash (See CVE-2014-4671). |
|
692 |
See https://github.com/Pylons/pyramid/pull/1649 |
|
693 |
|
|
694 |
- Allow periods and brackets (``[]``) in the JSONP callback. The original |
|
695 |
fix was overly-restrictive and broke Angular. |
|
696 |
See https://github.com/Pylons/pyramid/pull/1649 |
|
697 |
|
|
698 |
1.6a1 (2015-04-15) |
|
699 |
================== |
|
700 |
|
|
701 |
Features |
|
702 |
-------- |
|
703 |
|
|
704 |
- pcreate will now ask for confirmation if invoked with |
|
705 |
an argument for a project name that already exists or |
|
706 |
is importable in the current environment. |
|
707 |
See https://github.com/Pylons/pyramid/issues/1357 and |
|
708 |
https://github.com/Pylons/pyramid/pull/1837 |
|
709 |
|
|
710 |
- Make it possible to subclass ``pyramid.request.Request`` and also use |
|
711 |
``pyramid.request.Request.add_request.method``. See |
|
712 |
https://github.com/Pylons/pyramid/issues/1529 |
|
713 |
|
|
714 |
- The ``pyramid.config.Configurator`` has grown the ability to allow |
|
715 |
actions to call other actions during a commit-cycle. This enables much more |
|
716 |
logic to be placed into actions, such as the ability to invoke other actions |
|
717 |
or group them for improved conflict detection. We have also exposed and |
|
718 |
documented the config phases that Pyramid uses in order to further assist |
|
719 |
in building conforming addons. |
|
720 |
See https://github.com/Pylons/pyramid/pull/1513 |
|
721 |
|
|
722 |
- Add ``pyramid.request.apply_request_extensions`` function which can be |
|
723 |
used in testing to apply any request extensions configured via |
|
724 |
``config.add_request_method``. Previously it was only possible to test |
|
725 |
the extensions by going through Pyramid's router. |
|
726 |
See https://github.com/Pylons/pyramid/pull/1581 |
|
727 |
|
|
728 |
- pcreate when run without a scaffold argument will now print information on |
|
729 |
the missing flag, as well as a list of available scaffolds. |
|
730 |
See https://github.com/Pylons/pyramid/pull/1566 and |
|
731 |
https://github.com/Pylons/pyramid/issues/1297 |
|
732 |
|
|
733 |
- Added support / testing for 'pypy3' under Tox and Travis. |
|
734 |
See https://github.com/Pylons/pyramid/pull/1469 |
|
735 |
|
|
736 |
- Automate code coverage metrics across py2 and py3 instead of just py2. |
|
737 |
See https://github.com/Pylons/pyramid/pull/1471 |
|
738 |
|
|
739 |
- Cache busting for static resources has been added and is available via a new |
|
740 |
argument to ``pyramid.config.Configurator.add_static_view``: ``cachebust``. |
|
741 |
Core APIs are shipped for both cache busting via query strings and |
|
742 |
path segments and may be extended to fit into custom asset pipelines. |
|
743 |
See https://github.com/Pylons/pyramid/pull/1380 and |
|
744 |
https://github.com/Pylons/pyramid/pull/1583 |
|
745 |
|
|
746 |
- Add ``pyramid.config.Configurator.root_package`` attribute and init |
|
747 |
parameter to assist with includeable packages that wish to resolve |
|
748 |
resources relative to the package in which the ``Configurator`` was created. |
|
749 |
This is especially useful for addons that need to load asset specs from |
|
750 |
settings, in which case it is may be natural for a developer to define |
|
751 |
imports or assets relative to the top-level package. |
|
752 |
See https://github.com/Pylons/pyramid/pull/1337 |
|
753 |
|
|
754 |
- Added line numbers to the log formatters in the scaffolds to assist with |
|
755 |
debugging. See https://github.com/Pylons/pyramid/pull/1326 |
|
756 |
|
|
757 |
- Add new HTTP exception objects for status codes |
|
758 |
``428 Precondition Required``, ``429 Too Many Requests`` and |
|
759 |
``431 Request Header Fields Too Large`` in ``pyramid.httpexceptions``. |
|
760 |
See https://github.com/Pylons/pyramid/pull/1372/files |
|
761 |
|
|
762 |
- The ``pshell`` script will now load a ``PYTHONSTARTUP`` file if one is |
|
763 |
defined in the environment prior to launching the interpreter. |
|
764 |
See https://github.com/Pylons/pyramid/pull/1448 |
|
765 |
|
|
766 |
- Make it simple to define notfound and forbidden views that wish to use |
|
767 |
the default exception-response view but with altered predicates and other |
|
768 |
configuration options. The ``view`` argument is now optional in |
|
769 |
``config.add_notfound_view`` and ``config.add_forbidden_view``.. |
|
770 |
See https://github.com/Pylons/pyramid/issues/494 |
|
771 |
|
|
772 |
- Greatly improve the readability of the ``pcreate`` shell script output. |
|
773 |
See https://github.com/Pylons/pyramid/pull/1453 |
|
774 |
|
|
775 |
- Improve robustness to timing attacks in the ``AuthTktCookieHelper`` and |
|
776 |
the ``SignedCookieSessionFactory`` classes by using the stdlib's |
|
777 |
``hmac.compare_digest`` if it is available (such as Python 2.7.7+ and 3.3+). |
|
778 |
See https://github.com/Pylons/pyramid/pull/1457 |
|
779 |
|
|
780 |
- Assets can now be overidden by an absolute path on the filesystem when using |
|
781 |
the ``config.override_asset`` API. This makes it possible to fully support |
|
782 |
serving up static content from a mutable directory while still being able |
|
783 |
to use the ``request.static_url`` API and ``config.add_static_view``. |
|
784 |
Previously it was not possible to use ``config.add_static_view`` with an |
|
785 |
absolute path **and** generate urls to the content. This change replaces |
|
786 |
the call, ``config.add_static_view('/abs/path', 'static')``, with |
|
787 |
``config.add_static_view('myapp:static', 'static')`` and |
|
788 |
``config.override_asset(to_override='myapp:static/', |
|
789 |
override_with='/abs/path/')``. The ``myapp:static`` asset spec is completely |
|
790 |
made up and does not need to exist - it is used for generating urls |
|
791 |
via ``request.static_url('myapp:static/foo.png')``. |
|
792 |
See https://github.com/Pylons/pyramid/issues/1252 |
|
793 |
|
|
794 |
- Added ``pyramid.config.Configurator.set_response_factory`` and the |
|
795 |
``response_factory`` keyword argument to the ``Configurator`` for defining |
|
796 |
a factory that will return a custom ``Response`` class. |
|
797 |
See https://github.com/Pylons/pyramid/pull/1499 |
|
798 |
|
|
799 |
- Allow an iterator to be returned from a renderer. Previously it was only |
|
800 |
possible to return bytes or unicode. |
|
801 |
See https://github.com/Pylons/pyramid/pull/1417 |
|
802 |
|
|
803 |
- ``pserve`` can now take a ``-b`` or ``--browser`` option to open the server |
|
804 |
URL in a web browser. See https://github.com/Pylons/pyramid/pull/1533 |
|
805 |
|
|
806 |
- Overall improvments for the ``proutes`` command. Added ``--format`` and |
|
807 |
``--glob`` arguments to the command, introduced the ``method`` |
|
808 |
column for displaying available request methods, and improved the ``view`` |
|
809 |
output by showing the module instead of just ``__repr__``. |
|
810 |
See https://github.com/Pylons/pyramid/pull/1488 |
|
811 |
|
|
812 |
- Support keyword-only arguments and function annotations in views in |
|
813 |
Python 3. See https://github.com/Pylons/pyramid/pull/1556 |
|
814 |
|
|
815 |
- ``request.response`` will no longer be mutated when using the |
|
816 |
``pyramid.renderers.render_to_response()`` API. It is now necessary to |
|
817 |
pass in a ``response=`` argument to ``render_to_response`` if you wish to |
|
818 |
supply the renderer with a custom response object for it to use. If you |
|
819 |
do not pass one then a response object will be created using the |
|
820 |
application's ``IResponseFactory``. Almost all renderers |
|
821 |
mutate the ``request.response`` response object (for example, the JSON |
|
822 |
renderer sets ``request.response.content_type`` to ``application/json``). |
|
823 |
However, when invoking ``render_to_response`` it is not expected that the |
|
824 |
response object being returned would be the same one used later in the |
|
825 |
request. The response object returned from ``render_to_response`` is now |
|
826 |
explicitly different from ``request.response``. This does not change the |
|
827 |
API of a renderer. See https://github.com/Pylons/pyramid/pull/1563 |
|
828 |
|
|
829 |
- The ``append_slash`` argument of ```Configurator().add_notfound_view()`` will |
|
830 |
now accept anything that implements the ``IResponse`` interface and will use |
|
831 |
that as the response class instead of the default ``HTTPFound``. See |
|
832 |
https://github.com/Pylons/pyramid/pull/1610 |
|
833 |
|
|
834 |
Bug Fixes |
|
835 |
--------- |
|
836 |
|
|
837 |
- The JSONP renderer created JavaScript code in such a way that a callback |
|
838 |
variable could be used to arbitrarily inject javascript into the response |
|
839 |
object. https://github.com/Pylons/pyramid/pull/1627 |
|
840 |
|
|
841 |
- Work around an issue where ``pserve --reload`` would leave terminal echo |
|
842 |
disabled if it reloaded during a pdb session. |
|
843 |
See https://github.com/Pylons/pyramid/pull/1577, |
|
844 |
https://github.com/Pylons/pyramid/pull/1592 |
|
845 |
|
|
846 |
- ``pyramid.wsgi.wsgiapp`` and ``pyramid.wsgi.wsgiapp2`` now raise |
|
847 |
``ValueError`` when accidentally passed ``None``. |
|
848 |
See https://github.com/Pylons/pyramid/pull/1320 |
|
849 |
|
|
850 |
- Fix an issue whereby predicates would be resolved as maybe_dotted in the |
|
851 |
introspectable but not when passed for registration. This would mean that |
|
852 |
``add_route_predicate`` for example can not take a string and turn it into |
|
853 |
the actual callable function. |
|
854 |
See https://github.com/Pylons/pyramid/pull/1306 |
|
855 |
|
|
856 |
- Fix ``pyramid.testing.setUp`` to return a ``Configurator`` with a proper |
|
857 |
package. Previously it was not possible to do package-relative includes |
|
858 |
using the returned ``Configurator`` during testing. There is now a |
|
859 |
``package`` argument that can override this behavior as well. |
|
860 |
See https://github.com/Pylons/pyramid/pull/1322 |
|
861 |
|
|
862 |
- Fix an issue where a ``pyramid.response.FileResponse`` may apply a charset |
|
863 |
where it does not belong. See https://github.com/Pylons/pyramid/pull/1251 |
|
864 |
|
|
865 |
- Work around a bug introduced in Python 2.7.7 on Windows where |
|
866 |
``mimetypes.guess_type`` returns Unicode rather than str for the content |
|
867 |
type, unlike any previous version of Python. See |
|
868 |
https://github.com/Pylons/pyramid/issues/1360 for more information. |
|
869 |
|
|
870 |
- ``pcreate`` now normalizes the package name by converting hyphens to |
|
871 |
underscores. See https://github.com/Pylons/pyramid/pull/1376 |
|
872 |
|
|
873 |
- Fix an issue with the final response/finished callback being unable to |
|
874 |
add another callback to the list. See |
|
875 |
https://github.com/Pylons/pyramid/pull/1373 |
|
876 |
|
|
877 |
- Fix a failing unittest caused by differing mimetypes across various OSs. |
|
878 |
See https://github.com/Pylons/pyramid/issues/1405 |
|
879 |
|
|
880 |
- Fix route generation for static view asset specifications having no path. |
|
881 |
See https://github.com/Pylons/pyramid/pull/1377 |
|
882 |
|
|
883 |
- Allow the ``pyramid.renderers.JSONP`` renderer to work even if there is no |
|
884 |
valid request object. In this case it will not wrap the object in a |
|
885 |
callback and thus behave just like the ``pyramid.renderers.JSON`` renderer. |
|
886 |
See https://github.com/Pylons/pyramid/pull/1561 |
|
887 |
|
|
888 |
- Prevent "parameters to load are deprecated" ``DeprecationWarning`` |
|
889 |
from setuptools>=11.3. See https://github.com/Pylons/pyramid/pull/1541 |
|
890 |
|
|
891 |
- Avoiding sharing the ``IRenderer`` objects across threads when attached to |
|
892 |
a view using the `renderer=` argument. These renderers were instantiated |
|
893 |
at time of first render and shared between requests, causing potentially |
|
894 |
subtle effects like `pyramid.reload_templates = true` failing to work |
|
895 |
in `pyramid_mako`. See https://github.com/Pylons/pyramid/pull/1575 |
|
896 |
and https://github.com/Pylons/pyramid/issues/1268 |
|
897 |
|
|
898 |
- Avoiding timing attacks against CSRF tokens. |
|
899 |
See https://github.com/Pylons/pyramid/pull/1574 |
|
900 |
|
|
901 |
- ``request.finished_callbacks`` and ``request.response_callbacks`` now |
|
902 |
default to an iterable instead of ``None``. It may be checked for a length |
|
903 |
of 0. This was the behavior in 1.5. |
|
904 |
|
|
905 |
Deprecations |
|
906 |
------------ |
|
907 |
|
|
908 |
- The ``pserve`` command's daemonization features have been deprecated. This |
|
909 |
includes the ``[start,stop,restart,status]`` subcommands as well as the |
|
910 |
``--daemon``, ``--stop-server``, ``--pid-file``, and ``--status`` flags. |
|
911 |
|
|
912 |
Please use a real process manager in the future instead of relying on the |
|
913 |
``pserve`` to daemonize itself. Many options exist including your Operating |
|
914 |
System's services such as Systemd or Upstart, as well as Python-based |
|
915 |
solutions like Circus and Supervisor. |
|
916 |
|
|
917 |
See https://github.com/Pylons/pyramid/pull/1641 |
|
918 |
|
|
919 |
- Renamed the ``principal`` argument to ``pyramid.security.remember()`` to |
|
920 |
``userid`` in order to clarify its intended purpose. |
|
921 |
See https://github.com/Pylons/pyramid/pull/1399 |
|
922 |
|
|
923 |
Docs |
|
924 |
---- |
|
925 |
|
|
926 |
- Moved the documentation for ``accept`` on ``Configurator.add_view`` to no |
|
927 |
longer be part of the predicate list. See |
|
928 |
https://github.com/Pylons/pyramid/issues/1391 for a bug report stating |
|
929 |
``not_`` was failing on ``accept``. Discussion with @mcdonc led to the |
|
930 |
conclusion that it should not be documented as a predicate. |
|
931 |
See https://github.com/Pylons/pyramid/pull/1487 for this PR |
|
932 |
|
|
933 |
- Removed logging configuration from Quick Tutorial ini files except for |
|
934 |
scaffolding- and logging-related chapters to avoid needing to explain it too |
|
935 |
early. |
|
936 |
|
|
937 |
- Clarify a previously-implied detail of the ``ISession.invalidate`` API |
|
938 |
documentation. |
|
939 |
|
|
940 |
- Improve and clarify the documentation on what Pyramid defines as a |
|
941 |
``principal`` and a ``userid`` in its security APIs. |
|
942 |
See https://github.com/Pylons/pyramid/pull/1399 |
|
943 |
|
|
944 |
- Add documentation of command line programs (``p*`` scripts). See |
|
945 |
https://github.com/Pylons/pyramid/pull/2191 |
|
946 |
|
|
947 |
Scaffolds |
|
948 |
--------- |
|
949 |
|
|
950 |
- Update scaffold generating machinery to return the version of pyramid and |
|
951 |
pyramid docs for use in scaffolds. Updated starter, alchemy and zodb |
|
952 |
templates to have links to correctly versioned documentation and reflect |
|
953 |
which pyramid was used to generate the scaffold. |
|
954 |
|
|
955 |
- Removed non-ascii copyright symbol from templates, as this was |
|
956 |
causing the scaffolds to fail for project generation. |
|
957 |
|
|
958 |
- You can now run the scaffolding func tests via ``tox py2-scaffolds`` and |
|
959 |
``tox py3-scaffolds``. |
|
960 |
|
|
961 |
|
4b818c
|
962 |
1.5 (2014-04-08) |
CM |
963 |
================ |
|
964 |
|
169dba
|
965 |
- Python 3.4 compatibility. |
SP |
966 |
|
4b818c
|
967 |
- Avoid crash in ``pserve --reload`` under Py3k, when iterating over possibly |
CM |
968 |
mutated ``sys.modules``. |
|
969 |
|
|
970 |
- ``UnencryptedCookieSessionFactoryConfig`` failed if the secret contained |
|
971 |
higher order characters. See https://github.com/Pylons/pyramid/issues/1246 |
|
972 |
|
|
973 |
- Fixed a bug in ``UnencryptedCookieSessionFactoryConfig`` and |
|
974 |
``SignedCookieSessionFactory`` where ``timeout=None`` would cause a new |
|
975 |
session to always be created. Also in ``SignedCookieSessionFactory`` a |
|
976 |
``reissue_time=None`` would cause an exception when modifying the session. |
|
977 |
See https://github.com/Pylons/pyramid/issues/1247 |
|
978 |
|
|
979 |
- Updated docs and scaffolds to keep in step with new 2.0 release of |
|
980 |
``Lingua``. This included removing all ``setup.cfg`` files from scaffolds |
|
981 |
and documentation environments. |
|
982 |
|
|
983 |
1.5b1 (2014-02-08) |
|
984 |
================== |
|
985 |
|
|
986 |
Features |
|
987 |
-------- |
|
988 |
|
|
989 |
- We no longer eagerly clear ``request.exception`` and ``request.exc_info`` in |
|
990 |
the exception view tween. This makes it possible to inspect exception |
|
991 |
information within a finished callback. See |
|
992 |
https://github.com/Pylons/pyramid/issues/1223. |
|
993 |
|
|
994 |
1.5a4 (2014-01-28) |
|
995 |
================== |
|
996 |
|
|
997 |
Features |
|
998 |
-------- |
|
999 |
|
|
1000 |
- Updated scaffolds with new theme, fixed documentation and sample project. |
|
1001 |
|
|
1002 |
Bug Fixes |
|
1003 |
--------- |
|
1004 |
|
|
1005 |
- Depend on a newer version of WebOb so that we pull in some crucial bug-fixes |
|
1006 |
that were showstoppers for functionality in Pyramid. |
|
1007 |
|
|
1008 |
- Add a trailing semicolon to the JSONP response. This fixes JavaScript syntax |
|
1009 |
errors for old IE versions. See https://github.com/Pylons/pyramid/pull/1205 |
|
1010 |
|
|
1011 |
- Fix a memory leak when the configurator's ``set_request_property`` method was |
|
1012 |
used or when the configurator's ``add_request_method`` method was used with |
|
1013 |
the ``property=True`` attribute. See |
|
1014 |
https://github.com/Pylons/pyramid/issues/1212 . |
|
1015 |
|
|
1016 |
1.5a3 (2013-12-10) |
|
1017 |
================== |
|
1018 |
|
|
1019 |
Features |
|
1020 |
-------- |
|
1021 |
|
|
1022 |
- An authorization API has been added as a method of the |
|
1023 |
request: ``request.has_permission``. |
|
1024 |
|
|
1025 |
``request.has_permission`` is a method-based alternative to the |
|
1026 |
``pyramid.security.has_permission`` API and works exactly the same. The |
|
1027 |
older API is now deprecated. |
|
1028 |
|
|
1029 |
- Property API attributes have been added to the request for easier access to |
|
1030 |
authentication data: ``request.authenticated_userid``, |
|
1031 |
``request.unauthenticated_userid``, and ``request.effective_principals``. |
|
1032 |
|
|
1033 |
These are analogues, respectively, of |
|
1034 |
``pyramid.security.authenticated_userid``, |
|
1035 |
``pyramid.security.unauthenticated_userid``, and |
|
1036 |
``pyramid.security.effective_principals``. They operate exactly the same, |
|
1037 |
except they are attributes of the request instead of functions accepting a |
|
1038 |
request. They are properties, so they cannot be assigned to. The older |
|
1039 |
function-based APIs are now deprecated. |
|
1040 |
|
|
1041 |
- Pyramid's console scripts (``pserve``, ``pviews``, etc) can now be run |
|
1042 |
directly, allowing custom arguments to be sent to the python interpreter |
|
1043 |
at runtime. For example:: |
|
1044 |
|
|
1045 |
python -3 -m pyramid.scripts.pserve development.ini |
|
1046 |
|
|
1047 |
- Added a specific subclass of ``HTTPBadRequest`` named |
|
1048 |
``pyramid.exceptions.BadCSRFToken`` which will now be raised in response |
|
1049 |
to failures in ``check_csrf_token``. |
|
1050 |
See https://github.com/Pylons/pyramid/pull/1149 |
|
1051 |
|
|
1052 |
- Added a new ``SignedCookieSessionFactory`` which is very similar to the |
|
1053 |
``UnencryptedCookieSessionFactoryConfig`` but with a clearer focus on signing |
|
1054 |
content. The custom serializer arguments to this function should only focus |
|
1055 |
on serializing, unlike its predecessor which required the serializer to also |
|
1056 |
perform signing. See https://github.com/Pylons/pyramid/pull/1142 . Note |
|
1057 |
that cookies generated using ``SignedCookieSessionFactory`` are not |
|
1058 |
compatible with cookies generated using ``UnencryptedCookieSessionFactory``, |
|
1059 |
so existing user session data will be destroyed if you switch to it. |
|
1060 |
|
|
1061 |
- Added a new ``BaseCookieSessionFactory`` which acts as a generic cookie |
|
1062 |
factory that can be used by framework implementors to create their own |
|
1063 |
session implementations. It provides a reusable API which focuses strictly |
|
1064 |
on providing a dictionary-like object that properly handles renewals, |
|
1065 |
timeouts, and conformance with the ``ISession`` API. |
|
1066 |
See https://github.com/Pylons/pyramid/pull/1142 |
|
1067 |
|
|
1068 |
- The anchor argument to ``pyramid.request.Request.route_url`` and |
|
1069 |
``pyramid.request.Request.resource_url`` and their derivatives will now be |
|
1070 |
escaped via URL quoting to ensure minimal conformance. See |
|
1071 |
https://github.com/Pylons/pyramid/pull/1183 |
|
1072 |
|
|
1073 |
- Allow sending of ``_query`` and ``_anchor`` options to |
|
1074 |
``pyramid.request.Request.static_url`` when an external URL is being |
|
1075 |
generated. |
|
1076 |
See https://github.com/Pylons/pyramid/pull/1183 |
|
1077 |
|
|
1078 |
- You can now send a string as the ``_query`` argument to |
|
1079 |
``pyramid.request.Request.route_url`` and |
|
1080 |
``pyramid.request.Request.resource_url`` and their derivatives. When a |
|
1081 |
string is sent instead of a list or dictionary. it is URL-quoted however it |
|
1082 |
does not need to be in ``k=v`` form. This is useful if you want to be able |
|
1083 |
to use a different query string format than ``x-www-form-urlencoded``. See |
|
1084 |
https://github.com/Pylons/pyramid/pull/1183 |
|
1085 |
|
|
1086 |
- ``pyramid.testing.DummyRequest`` now has a ``domain`` attribute to match the |
|
1087 |
new WebOb 1.3 API. Its value is ``example.com``. |
|
1088 |
|
|
1089 |
Bug Fixes |
|
1090 |
--------- |
|
1091 |
|
|
1092 |
- Fix the ``pcreate`` script so that when the target directory name ends with a |
|
1093 |
slash it does not produce a non-working project directory structure. |
|
1094 |
Previously saying ``pcreate -s starter /foo/bar/`` produced different output |
|
1095 |
than saying ``pcreate -s starter /foo/bar``. The former did not work |
|
1096 |
properly. |
|
1097 |
|
|
1098 |
- Fix the ``principals_allowed_by_permission`` method of |
|
1099 |
``ACLAuthorizationPolicy`` so it anticipates a callable ``__acl__`` |
|
1100 |
on resources. Previously it did not try to call the ``__acl__`` |
|
1101 |
if it was callable. |
|
1102 |
|
|
1103 |
- The ``pviews`` script did not work when a url required custom request |
|
1104 |
methods in order to perform traversal. Custom methods and descriptors added |
|
1105 |
via ``pyramid.config.Configurator.add_request_method`` will now be present, |
|
1106 |
allowing traversal to continue. |
|
1107 |
See https://github.com/Pylons/pyramid/issues/1104 |
|
1108 |
|
|
1109 |
- Remove unused ``renderer`` argument from ``Configurator.add_route``. |
|
1110 |
|
|
1111 |
- Allow the ``BasicAuthenticationPolicy`` to work with non-ascii usernames |
|
1112 |
and passwords. The charset is not passed as part of the header and different |
|
1113 |
browsers alternate between UTF-8 and Latin-1, so the policy now attempts |
|
1114 |
to decode with UTF-8 first, and will fallback to Latin-1. |
|
1115 |
See https://github.com/Pylons/pyramid/pull/1170 |
|
1116 |
|
|
1117 |
- The ``@view_defaults`` now apply to notfound and forbidden views |
|
1118 |
that are defined as methods of a decorated class. |
|
1119 |
See https://github.com/Pylons/pyramid/issues/1173 |
|
1120 |
|
|
1121 |
Documentation |
|
1122 |
------------- |
|
1123 |
|
|
1124 |
- Added a "Quick Tutorial" to go with the Quick Tour |
|
1125 |
|
|
1126 |
- Removed mention of ``pyramid_beaker`` from docs. Beaker is no longer |
|
1127 |
maintained. Point people at ``pyramid_redis_sessions`` instead. |
|
1128 |
|
|
1129 |
- Add documentation for ``pyramid.interfaces.IRendererFactory`` and |
|
1130 |
``pyramid.interfaces.IRenderer``. |
|
1131 |
|
|
1132 |
Backwards Incompatibilities |
|
1133 |
--------------------------- |
|
1134 |
|
|
1135 |
- The key/values in the ``_query`` parameter of ``request.route_url`` and the |
|
1136 |
``query`` parameter of ``request.resource_url`` (and their variants), used |
|
1137 |
to encode a value of ``None`` as the string ``'None'``, leaving the resulting |
|
1138 |
query string to be ``a=b&key=None``. The value is now dropped in this |
|
1139 |
situation, leaving a query string of ``a=b&key=``. |
|
1140 |
See https://github.com/Pylons/pyramid/issues/1119 |
|
1141 |
|
|
1142 |
Deprecations |
|
1143 |
------------ |
|
1144 |
|
|
1145 |
- Deprecate the ``pyramid.interfaces.ITemplateRenderer`` interface. It was |
|
1146 |
ill-defined and became unused when Mako and Chameleon template bindings were |
|
1147 |
split into their own packages. |
|
1148 |
|
|
1149 |
- The ``pyramid.session.UnencryptedCookieSessionFactoryConfig`` API has been |
|
1150 |
deprecated and is superseded by the |
|
1151 |
``pyramid.session.SignedCookieSessionFactory``. Note that while the cookies |
|
1152 |
generated by the ``UnencryptedCookieSessionFactoryConfig`` |
|
1153 |
are compatible with cookies generated by old releases, cookies generated by |
|
1154 |
the SignedCookieSessionFactory are not. See |
|
1155 |
https://github.com/Pylons/pyramid/pull/1142 |
|
1156 |
|
|
1157 |
- The ``pyramid.security.has_permission`` API is now deprecated. Instead, use |
|
1158 |
the newly-added ``has_permission`` method of the request object. |
|
1159 |
|
|
1160 |
- The ``pyramid.security.effective_principals`` API is now deprecated. |
|
1161 |
Instead, use the newly-added ``effective_principals`` attribute of the |
|
1162 |
request object. |
|
1163 |
|
|
1164 |
- The ``pyramid.security.authenticated_userid`` API is now deprecated. |
|
1165 |
Instead, use the newly-added ``authenticated_userid`` attribute of the |
|
1166 |
request object. |
|
1167 |
|
|
1168 |
- The ``pyramid.security.unauthenticated_userid`` API is now deprecated. |
|
1169 |
Instead, use the newly-added ``unauthenticated_userid`` attribute of the |
|
1170 |
request object. |
|
1171 |
|
|
1172 |
Dependencies |
|
1173 |
------------ |
|
1174 |
|
|
1175 |
- Pyramid now depends on WebOb>=1.3 (it uses ``webob.cookies.CookieProfile`` |
|
1176 |
from 1.3+). |
|
1177 |
|
|
1178 |
1.5a2 (2013-09-22) |
|
1179 |
================== |
|
1180 |
|
|
1181 |
Features |
|
1182 |
-------- |
|
1183 |
|
|
1184 |
- Users can now provide dotted Python names to as the ``factory`` argument |
|
1185 |
the Configurator methods named ``add_{view,route,subscriber}_predicate`` |
|
1186 |
(instead of passing the predicate factory directly, you can pass a |
|
1187 |
dotted name which refers to the factory). |
|
1188 |
|
|
1189 |
Bug Fixes |
|
1190 |
--------- |
|
1191 |
|
|
1192 |
- Fix an exception in ``pyramid.path.package_name`` when resolving the package |
|
1193 |
name for namespace packages that had no ``__file__`` attribute. |
|
1194 |
|
|
1195 |
Backwards Incompatibilities |
|
1196 |
--------------------------- |
|
1197 |
|
|
1198 |
- Pyramid no longer depends on or configures the Mako and Chameleon templating |
|
1199 |
system renderers by default. Disincluding these templating systems by |
|
1200 |
default means that the Pyramid core has fewer dependencies and can run on |
|
1201 |
future platforms without immediate concern for the compatibility of its |
|
1202 |
templating add-ons. It also makes maintenance slightly more effective, as |
|
1203 |
different people can maintain the templating system add-ons that they |
|
1204 |
understand and care about without needing commit access to the Pyramid core, |
|
1205 |
and it allows users who just don't want to see any packages they don't use |
|
1206 |
come along for the ride when they install Pyramid. |
|
1207 |
|
|
1208 |
This means that upon upgrading to Pyramid 1.5a2+, projects that use either |
|
1209 |
of these templating systems will see a traceback that ends something like |
|
1210 |
this when their application attempts to render a Chameleon or Mako template:: |
|
1211 |
|
|
1212 |
ValueError: No such renderer factory .pt |
|
1213 |
|
|
1214 |
Or:: |
|
1215 |
|
|
1216 |
ValueError: No such renderer factory .mako |
|
1217 |
|
|
1218 |
Or:: |
|
1219 |
|
|
1220 |
ValueError: No such renderer factory .mak |
|
1221 |
|
|
1222 |
Support for Mako templating has been moved into an add-on package named |
|
1223 |
``pyramid_mako``, and support for Chameleon templating has been moved into |
|
1224 |
an add-on package named ``pyramid_chameleon``. These packages are drop-in |
|
1225 |
replacements for the old built-in support for these templating langauges. |
|
1226 |
All you have to do is install them and make them active in your configuration |
|
1227 |
to register renderer factories for ``.pt`` and/or ``.mako`` (or ``.mak``) to |
|
1228 |
make your application work again. |
|
1229 |
|
|
1230 |
To re-add support for Chameleon and/or Mako template renderers into your |
|
1231 |
existing projects, follow the below steps. |
|
1232 |
|
|
1233 |
If you depend on Mako templates: |
|
1234 |
|
|
1235 |
* Make sure the ``pyramid_mako`` package is installed. One way to do this |
|
1236 |
is by adding ``pyramid_mako`` to the ``install_requires`` section of your |
|
1237 |
package's ``setup.py`` file and afterwards rerunning ``setup.py develop``:: |
|
1238 |
|
|
1239 |
setup( |
|
1240 |
#... |
|
1241 |
install_requires=[ |
|
1242 |
'pyramid_mako', # new dependency |
|
1243 |
'pyramid', |
|
1244 |
#... |
|
1245 |
], |
|
1246 |
) |
|
1247 |
|
|
1248 |
* Within the portion of your application which instantiates a Pyramid |
|
1249 |
``pyramid.config.Configurator`` (often the ``main()`` function in |
|
1250 |
your project's ``__init__.py`` file), tell Pyramid to include the |
|
1251 |
``pyramid_mako`` includeme:: |
|
1252 |
|
|
1253 |
config = Configurator(.....) |
|
1254 |
config.include('pyramid_mako') |
|
1255 |
|
|
1256 |
If you depend on Chameleon templates: |
|
1257 |
|
|
1258 |
* Make sure the ``pyramid_chameleon`` package is installed. One way to do |
|
1259 |
this is by adding ``pyramid_chameleon`` to the ``install_requires`` section |
|
1260 |
of your package's ``setup.py`` file and afterwards rerunning |
|
1261 |
``setup.py develop``:: |
|
1262 |
|
|
1263 |
setup( |
|
1264 |
#... |
|
1265 |
install_requires=[ |
|
1266 |
'pyramid_chameleon', # new dependency |
|
1267 |
'pyramid', |
|
1268 |
#... |
|
1269 |
], |
|
1270 |
) |
|
1271 |
|
|
1272 |
* Within the portion of your application which instantiates a Pyramid |
|
1273 |
``~pyramid.config.Configurator`` (often the ``main()`` function in |
|
1274 |
your project's ``__init__.py`` file), tell Pyramid to include the |
|
1275 |
``pyramid_chameleon`` includeme:: |
|
1276 |
|
|
1277 |
config = Configurator(.....) |
|
1278 |
config.include('pyramid_chameleon') |
|
1279 |
|
|
1280 |
Note that it's also fine to install these packages into *older* Pyramids for |
|
1281 |
forward compatibility purposes. Even if you don't upgrade to Pyramid 1.5 |
|
1282 |
immediately, performing the above steps in a Pyramid 1.4 installation is |
|
1283 |
perfectly fine, won't cause any difference, and will give you forward |
|
1284 |
compatibility when you eventually do upgrade to Pyramid 1.5. |
|
1285 |
|
|
1286 |
With the removal of Mako and Chameleon support from the core, some |
|
1287 |
unit tests that use the ``pyramid.renderers.render*`` methods may begin to |
|
1288 |
fail. If any of your unit tests are invoking either |
|
1289 |
``pyramid.renderers.render()`` or ``pyramid.renderers.render_to_response()`` |
|
1290 |
with either Mako or Chameleon templates then the |
|
1291 |
``pyramid.config.Configurator`` instance in effect during |
|
1292 |
the unit test should be also be updated to include the addons, as shown |
|
1293 |
above. For example:: |
|
1294 |
|
|
1295 |
class ATest(unittest.TestCase): |
|
1296 |
def setUp(self): |
|
1297 |
self.config = pyramid.testing.setUp() |
|
1298 |
self.config.include('pyramid_mako') |
|
1299 |
|
|
1300 |
def test_it(self): |
|
1301 |
result = pyramid.renderers.render('mypkg:templates/home.mako', {}) |
|
1302 |
|
|
1303 |
Or:: |
|
1304 |
|
|
1305 |
class ATest(unittest.TestCase): |
|
1306 |
def setUp(self): |
|
1307 |
self.config = pyramid.testing.setUp() |
|
1308 |
self.config.include('pyramid_chameleon') |
|
1309 |
|
|
1310 |
def test_it(self): |
|
1311 |
result = pyramid.renderers.render('mypkg:templates/home.pt', {}) |
|
1312 |
|
|
1313 |
- If you're using the Pyramid debug toolbar, when you upgrade Pyramid to |
|
1314 |
1.5a2+, you'll also need to upgrade the ``pyramid_debugtoolbar`` package to |
|
1315 |
at least version 1.0.8, as older toolbar versions are not compatible with |
|
1316 |
Pyramid 1.5a2+ due to the removal of Mako support from the core. It's |
|
1317 |
fine to use this newer version of the toolbar code with older Pyramids too. |
|
1318 |
|
|
1319 |
- Removed the ``request.response_*`` varying attributes. These attributes |
|
1320 |
have been deprecated since Pyramid 1.1, and as per the deprecation policy, |
|
1321 |
have now been removed. |
|
1322 |
|
|
1323 |
- ``request.response`` will no longer be mutated when using the |
|
1324 |
``pyramid.renderers.render()`` API. Almost all renderers mutate the |
|
1325 |
``request.response`` response object (for example, the JSON renderer sets |
|
1326 |
``request.response.content_type`` to ``application/json``), but this is |
|
1327 |
only necessary when the renderer is generating a response; it was a bug |
|
1328 |
when it was done as a side effect of calling ``pyramid.renderers.render()``. |
|
1329 |
|
|
1330 |
- Removed the ``bfg2pyramid`` fixer script. |
|
1331 |
|
|
1332 |
- The ``pyramid.events.NewResponse`` event is now sent **after** response |
|
1333 |
callbacks are executed. It previously executed before response callbacks |
|
1334 |
were executed. Rationale: it's more useful to be able to inspect the response |
|
1335 |
after response callbacks have done their jobs instead of before. |
|
1336 |
|
|
1337 |
- Removed the class named ``pyramid.view.static`` that had been deprecated |
|
1338 |
since Pyramid 1.1. Instead use ``pyramid.static.static_view`` with |
|
1339 |
``use_subpath=True`` argument. |
|
1340 |
|
|
1341 |
- Removed the ``pyramid.view.is_response`` function that had been deprecated |
|
1342 |
since Pyramid 1.1. Use the ``pyramid.request.Request.is_response`` method |
|
1343 |
instead. |
|
1344 |
|
|
1345 |
- Removed the ability to pass the following arguments to |
|
1346 |
``pyramid.config.Configurator.add_route``: ``view``, ``view_context``. |
|
1347 |
``view_for``, ``view_permission``, ``view_renderer``, and ``view_attr``. |
|
1348 |
Using these arguments had been deprecated since Pyramid 1.1. Instead of |
|
1349 |
passing view-related arguments to ``add_route``, use a separate call to |
|
1350 |
``pyramid.config.Configurator.add_view`` to associate a view with a route |
|
1351 |
using its ``route_name`` argument. Note that this impacts the |
|
1352 |
``pyramid.config.Configurator.add_static_view`` function too, because it |
|
1353 |
delegates to ``add_route``. |
|
1354 |
|
|
1355 |
- Removed the ability to influence and query a ``pyramid.request.Request`` |
|
1356 |
object as if it were a dictionary. Previously it was possible to use methods |
|
1357 |
like ``__getitem__``, ``get``, ``items``, and other dictlike methods to |
|
1358 |
access values in the WSGI environment. This behavior had been deprecated |
|
1359 |
since Pyramid 1.1. Use methods of ``request.environ`` (a real dictionary) |
|
1360 |
instead. |
|
1361 |
|
|
1362 |
- Removed ancient backwards compatibily hack in |
|
1363 |
``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of |
|
1364 |
the factory with the matchdict values for compatibility with BFG 0.9. |
|
1365 |
|
|
1366 |
- The ``renderer_globals_factory`` argument to the |
|
1367 |
``pyramid.config.Configurator` constructor and its ``setup_registry`` method |
|
1368 |
has been removed. The ``set_renderer_globals_factory`` method of |
|
1369 |
``pyramid.config.Configurator`` has also been removed. The (internal) |
|
1370 |
``pyramid.interfaces.IRendererGlobals`` interface was also removed. These |
|
1371 |
arguments, methods and interfaces had been deprecated since 1.1. Use a |
|
1372 |
``BeforeRender`` event subscriber as documented in the "Hooks" chapter of the |
|
1373 |
Pyramid narrative documentation instead of providing renderer globals values |
|
1374 |
to the configurator. |
|
1375 |
|
|
1376 |
Deprecations |
|
1377 |
------------ |
|
1378 |
|
|
1379 |
- The ``pyramid.config.Configurator.set_request_property`` method now issues |
|
1380 |
a deprecation warning when used. It had been docs-deprecated in 1.4 |
|
1381 |
but did not issue a deprecation warning when used. |
|
1382 |
|
|
1383 |
1.5a1 (2013-08-30) |
|
1384 |
================== |
|
1385 |
|
|
1386 |
Features |
|
1387 |
-------- |
|
1388 |
|
|
1389 |
- A new http exception subclass named ``pyramid.httpexceptions.HTTPSuccessful`` |
|
1390 |
was added. You can use this class as the ``context`` of an exception |
|
1391 |
view to catch all 200-series "exceptions" (e.g. "raise HTTPOk"). This |
|
1392 |
also allows you to catch *only* the ``HTTPOk`` exception itself; previously |
|
1393 |
this was impossible because a number of other exceptions |
|
1394 |
(such as ``HTTPNoContent``) inherited from ``HTTPOk``, but now they do not. |
|
1395 |
|
|
1396 |
- You can now generate "hybrid" urldispatch/traversal URLs more easily |
|
1397 |
by using the new ``route_name``, ``route_kw`` and ``route_remainder_name`` |
|
1398 |
arguments to ``request.resource_url`` and ``request.resource_path``. See |
|
1399 |
the new section of the "Combining Traversal and URL Dispatch" documentation |
|
1400 |
chapter entitled "Hybrid URL Generation". |
|
1401 |
|
|
1402 |
- It is now possible to escape double braces in Pyramid scaffolds (unescaped, |
|
1403 |
these represent replacement values). You can use ``\{\{a\}\}`` to |
|
1404 |
represent a "bare" ``{{a}}``. See |
|
1405 |
https://github.com/Pylons/pyramid/pull/862 |
|
1406 |
|
|
1407 |
- Add ``localizer`` and ``locale_name`` properties (reified) to the request. |
|
1408 |
See https://github.com/Pylons/pyramid/issues/508. Note that the |
|
1409 |
``pyramid.i18n.get_localizer`` and ``pyramid.i18n.get_locale_name`` functions |
|
1410 |
now simply look up these properties on the request. |
|
1411 |
|
|
1412 |
- Add ``pdistreport`` script, which prints the Python version in use, the |
|
1413 |
Pyramid version in use, and the version number and location of all Python |
|
1414 |
distributions currently installed. |
|
1415 |
|
|
1416 |
- Add the ability to invert the result of any view, route, or subscriber |
|
1417 |
predicate using the ``not_`` class. For example:: |
|
1418 |
|
|
1419 |
from pyramid.config import not_ |
|
1420 |
|
|
1421 |
@view_config(route_name='myroute', request_method=not_('POST')) |
|
1422 |
def myview(request): ... |
|
1423 |
|
|
1424 |
The above example will ensure that the view is called if the request method |
|
1425 |
is not POST (at least if no other view is more specific). |
|
1426 |
|
|
1427 |
The ``pyramid.config.not_`` class can be used against any value that is |
|
1428 |
a predicate value passed in any of these contexts: |
|
1429 |
|
|
1430 |
- ``pyramid.config.Configurator.add_view`` |
|
1431 |
|
|
1432 |
- ``pyramid.config.Configurator.add_route`` |
|
1433 |
|
|
1434 |
- ``pyramid.config.Configurator.add_subscriber`` |
|
1435 |
|
|
1436 |
- ``pyramid.view.view_config`` |
|
1437 |
|
|
1438 |
- ``pyramid.events.subscriber`` |
|
1439 |
|
|
1440 |
- ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH`` |
|
1441 |
requests. See https://github.com/Pylons/pyramid/pull/1033. add support for |
|
1442 |
submitting ``OPTIONS`` and ``PROPFIND`` requests, and allow users to specify |
|
1443 |
basic authentication credentials in the request via a ``--login`` argument to |
|
1444 |
the script. See https://github.com/Pylons/pyramid/pull/1039. |
|
1445 |
|
|
1446 |
- ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This |
|
1447 |
removes the ambiguity between the potential ``AttributeError`` that would |
|
1448 |
be raised on the ``context`` when the property was not defined and the |
|
1449 |
``AttributeError`` that could be raised from any user-defined code within |
|
1450 |
a dynamic property. It is recommended to define a dynamic ACL as a callable |
|
1451 |
to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735. |
|
1452 |
|
|
1453 |
- Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to |
|
1454 |
``pyramid.config.Configurator.add_static_view``. This allows |
|
1455 |
externally-hosted static URLs to be generated based on the current protocol. |
|
1456 |
|
|
1457 |
- The ``AuthTktAuthenticationPolicy`` has two new options to configure its |
|
1458 |
domain usage: |
|
1459 |
|
|
1460 |
* ``parent_domain``: if set the authentication cookie is set on |
|
1461 |
the parent domain. This is useful if you have multiple sites sharing the |
|
1462 |
same domain. |
|
1463 |
* ``domain``: if provided the cookie is always set for this domain, bypassing |
|
1464 |
all usual logic. |
|
1465 |
|
|
1466 |
See https://github.com/Pylons/pyramid/pull/1028, |
|
1467 |
https://github.com/Pylons/pyramid/pull/1072 and |
|
1468 |
https://github.com/Pylons/pyramid/pull/1078. |
|
1469 |
|
|
1470 |
- The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using |
|
1471 |
the ``include_ip=True`` option. This is possibly incompatible with |
|
1472 |
alternative ``auth_tkt`` implementations, as the specification does not |
|
1473 |
define how to properly handle IPv6. See |
|
1474 |
https://github.com/Pylons/pyramid/issues/831. |
|
1475 |
|
|
1476 |
- Make it possible to use variable arguments via |
|
1477 |
``pyramid.paster.get_appsettings``. This also allowed the generated |
|
1478 |
``initialize_db`` script from the ``alchemy`` scaffold to grow support |
|
1479 |
for options in the form ``a=1 b=2`` so you can fill in |
|
1480 |
values in a parameterized ``.ini`` file, e.g. |
|
1481 |
``initialize_myapp_db etc/development.ini a=1 b=2``. |
|
1482 |
See https://github.com/Pylons/pyramid/pull/911 |
|
1483 |
|
|
1484 |
- The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view |
|
1485 |
predicate now take into account the value of the HTTP header named |
|
1486 |
``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they |
|
1487 |
always did). The header is tried when the form parameter does not exist. |
|
1488 |
|
|
1489 |
- View lookup will now search for valid views based on the inheritance |
|
1490 |
hierarchy of the context. It tries to find views based on the most |
|
1491 |
specific context first, and upon predicate failure, will move up the |
|
1492 |
inheritance chain to test views found by the super-type of the context. |
|
1493 |
In the past, only the most specific type containing views would be checked |
|
1494 |
and if no matching view could be found then a PredicateMismatch would be |
|
1495 |
raised. Now predicate mismatches don't hide valid views registered on |
|
1496 |
super-types. Here's an example that now works:: |
|
1497 |
|
|
1498 |
class IResource(Interface): |
|
1499 |
|
|
1500 |
... |
|
1501 |
|
|
1502 |
@view_config(context=IResource) |
|
1503 |
def get(context, request): |
|
1504 |
|
|
1505 |
... |
|
1506 |
|
|
1507 |
@view_config(context=IResource, request_method='POST') |
|
1508 |
def post(context, request): |
|
1509 |
|
|
1510 |
... |
|
1511 |
|
|
1512 |
@view_config(context=IResource, request_method='DELETE') |
|
1513 |
def delete(context, request): |
|
1514 |
|
|
1515 |
... |
|
1516 |
|
|
1517 |
@implementer(IResource) |
|
1518 |
class MyResource: |
|
1519 |
|
|
1520 |
... |
|
1521 |
|
|
1522 |
@view_config(context=MyResource, request_method='POST') |
|
1523 |
def override_post(context, request): |
|
1524 |
|
|
1525 |
... |
|
1526 |
|
|
1527 |
Previously the override_post view registration would hide the get |
|
1528 |
and delete views in the context of MyResource -- leading to a |
|
1529 |
predicate mismatch error when trying to use GET or DELETE |
|
1530 |
methods. Now the views are found and no predicate mismatch is |
|
1531 |
raised. |
|
1532 |
See https://github.com/Pylons/pyramid/pull/786 and |
|
1533 |
https://github.com/Pylons/pyramid/pull/1004 and |
|
1534 |
https://github.com/Pylons/pyramid/pull/1046 |
|
1535 |
|
|
1536 |
- The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a |
|
1537 |
``-q`` (or ``--quiet``) flag. Output from running ``pserve`` can be |
|
1538 |
controlled using these flags. ``-v`` can be specified multiple times to |
|
1539 |
increase verbosity. ``-q`` sets verbosity to ``0`` unconditionally. The |
|
1540 |
default verbosity level is ``1``. |
|
1541 |
|
|
1542 |
- The ``alchemy`` scaffold tests now provide better coverage. See |
|
1543 |
https://github.com/Pylons/pyramid/pull/1029 |
|
1544 |
|
|
1545 |
- The ``pyramid.config.Configurator.add_route`` method now supports being |
|
1546 |
called with an external URL as pattern. See |
|
1547 |
https://github.com/Pylons/pyramid/issues/611 and the documentation section |
|
1548 |
in the "URL Dispatch" chapter entitled "External Routes" for more information. |
|
1549 |
|
|
1550 |
Bug Fixes |
|
1551 |
--------- |
|
1552 |
|
|
1553 |
- It was not possible to use ``pyramid.httpexceptions.HTTPException`` as |
|
1554 |
the ``context`` of an exception view as very general catchall for |
|
1555 |
http-related exceptions when you wanted that exception view to override the |
|
1556 |
default exception view. See https://github.com/Pylons/pyramid/issues/985 |
|
1557 |
|
|
1558 |
- When the ``pyramid.reload_templates`` setting was true, and a Chameleon |
|
1559 |
template was reloaded, and the renderer specification named a macro |
|
1560 |
(e.g. ``foo#macroname.pt``), renderings of the template after the template |
|
1561 |
was reloaded due to a file change would produce the entire template body |
|
1562 |
instead of just a rendering of the macro. See |
|
1563 |
https://github.com/Pylons/pyramid/issues/1013. |
|
1564 |
|
|
1565 |
- Fix an obscure problem when combining a virtual root with a route with a |
|
1566 |
``*traverse`` in its pattern. Now the traversal path generated in |
|
1567 |
such a configuration will be correct, instead of an element missing |
|
1568 |
a leading slash. |
|
1569 |
|
|
1570 |
- Fixed a Mako renderer bug returning a tuple with a previous defname value |
|
1571 |
in some circumstances. See https://github.com/Pylons/pyramid/issues/1037 |
|
1572 |
for more information. |
|
1573 |
|
|
1574 |
- Make the ``pyramid.config.assets.PackageOverrides`` object implement the API |
|
1575 |
for ``__loader__`` objects specified in PEP 302. Proxies to the |
|
1576 |
``__loader__`` set by the importer, if present; otherwise, raises |
|
1577 |
``NotImplementedError``. This makes Pyramid static view overrides work |
|
1578 |
properly under Python 3.3 (previously they would not). See |
|
1579 |
https://github.com/Pylons/pyramid/pull/1015 for more information. |
|
1580 |
|
|
1581 |
- ``mako_templating``: added defensive workaround for non-importability of |
|
1582 |
``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support. Mako |
|
1583 |
templating will no longer work under the combination of MarkupSafe 0.17 and |
|
1584 |
Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any |
|
1585 |
supported Python 2 version will work OK). |
|
1586 |
|
|
1587 |
- Spaces and dots may now be in mako renderer template paths. This was |
|
1588 |
broken when support for the new makodef syntax was added in 1.4a1. |
|
1589 |
See https://github.com/Pylons/pyramid/issues/950 |
|
1590 |
|
|
1591 |
- ``pyramid.debug_authorization=true`` will now correctly print out |
|
1592 |
``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead |
|
1593 |
of invoking the ``permits`` method of the authorization policy. |
|
1594 |
See https://github.com/Pylons/pyramid/issues/954 |
|
1595 |
|
|
1596 |
- Pyramid failed to install on some systems due to being packaged with |
|
1597 |
some test files containing higher order characters in their names. These |
|
1598 |
files have now been removed. See |
|
1599 |
https://github.com/Pylons/pyramid/issues/981 |
|
1600 |
|
|
1601 |
- ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under |
|
1602 |
Python 3 would use ``__len__`` to find truthiness; this usually caused an |
|
1603 |
instance of DummyResource to be "falsy" instead of "truthy". See |
|
1604 |
https://github.com/Pylons/pyramid/pull/1032 |
|
1605 |
|
|
1606 |
- The ``alchemy`` scaffold would break when the database was MySQL during |
|
1607 |
tables creation. See https://github.com/Pylons/pyramid/pull/1049 |
|
1608 |
|
|
1609 |
- The ``current_route_url`` method now attaches the query string to the URL by |
|
1610 |
default. See |
|
1611 |
https://github.com/Pylons/pyramid/issues/1040 |
|
1612 |
|
|
1613 |
- Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See |
|
1614 |
https://github.com/Pylons/pyramid/issues/718 |
|
1615 |
|
|
1616 |
Backwards Incompatibilities |
|
1617 |
--------------------------- |
|
1618 |
|
|
1619 |
- Modified the ``current_route_url`` method in pyramid.Request. The method |
|
1620 |
previously returned the URL without the query string by default, it now does |
|
1621 |
attach the query string unless it is overriden. |
|
1622 |
|
|
1623 |
- The ``route_url`` and ``route_path`` APIs no longer quote ``/`` |
|
1624 |
to ``%2F`` when a replacement value contains a ``/``. This was pointless, |
|
1625 |
as WSGI servers always unquote the slash anyway, and Pyramid never sees the |
|
1626 |
quoted value. |
|
1627 |
|
|
1628 |
- It is no longer possible to set a ``locale_name`` attribute of the request, |
|
1629 |
nor is it possible to set a ``localizer`` attribute of the request. These |
|
1630 |
are now "reified" properties that look up a locale name and localizer |
|
1631 |
respectively using the machinery described in the "Internationalization" |
|
1632 |
chapter of the documentation. |
|
1633 |
|
|
1634 |
- If you send an ``X-Vhm-Root`` header with a value that ends with a slash (or |
|
1635 |
any number of slashes), the trailing slash(es) will be removed before a URL |
|
1636 |
is generated when you use use ``request.resource_url`` or |
|
1637 |
``request.resource_path``. Previously the virtual root path would not have |
|
1638 |
trailing slashes stripped, which would influence URL generation. |
|
1639 |
|
|
1640 |
- The ``pyramid.interfaces.IResourceURL`` interface has now grown two new |
|
1641 |
attributes: ``virtual_path_tuple`` and ``physical_path_tuple``. These should |
|
1642 |
be the tuple form of the resource's path (physical and virtual). |
|
1643 |
|
4a86b2
|
1644 |
1.4 (2012-12-18) |
CM |
1645 |
================ |
|
1646 |
|
|
1647 |
Docs |
|
1648 |
---- |
|
1649 |
|
|
1650 |
- Fix functional tests in the ZODB tutorial |
|
1651 |
|
|
1652 |
1.4b3 (2012-12-10) |
|
1653 |
================== |
|
1654 |
|
|
1655 |
- Packaging release only, no code changes. 1.4b2 was a brownbag release due to |
|
1656 |
missing directories in the tarball. |
|
1657 |
|
|
1658 |
1.4b2 (2012-12-10) |
|
1659 |
================== |
|
1660 |
|
|
1661 |
Docs |
|
1662 |
---- |
|
1663 |
|
|
1664 |
- Scaffolding is now PEP-8 compliant (at least for a brief shining moment). |
|
1665 |
|
|
1666 |
- Tutorial improvements. |
|
1667 |
|
|
1668 |
Backwards Incompatibilities |
|
1669 |
--------------------------- |
|
1670 |
|
|
1671 |
- Modified the ``_depth`` argument to ``pyramid.view.view_config`` to accept |
|
1672 |
a value relative to the invocation of ``view_config`` itself. Thus, when it |
|
1673 |
was previously expecting a value of ``1`` or greater, to reflect that |
|
1674 |
the caller of ``view_config`` is 1 stack frame away from ``venusian.attach``, |
|
1675 |
this implementation detail is now hidden. |
|
1676 |
|
|
1677 |
- Modified the ``_backframes`` argument to ``pyramid.util.action_method`` in a |
|
1678 |
similar way to the changes described to ``_depth`` above. This argument |
|
1679 |
remains undocumented, but might be used in the wild by some insane person. |
|
1680 |
|
|
1681 |
1.4b1 (2012-11-21) |
|
1682 |
================== |
|
1683 |
|
|
1684 |
Features |
|
1685 |
-------- |
|
1686 |
|
|
1687 |
- Small microspeed enhancement which anticipates that a |
|
1688 |
``pyramid.response.Response`` object is likely to be returned from a view. |
|
1689 |
Some code is shortcut if the class of the object returned by a view is this |
|
1690 |
class. A similar microoptimization was done to |
|
1691 |
``pyramid.request.Request.is_response``. |
|
1692 |
|
|
1693 |
- Make it possible to use variable arguments on ``p*`` commands (``pserve``, |
|
1694 |
``pshell``, ``pviews``, etc) in the form ``a=1 b=2`` so you can fill in |
|
1695 |
values in parameterized ``.ini`` file, e.g. ``pshell etc/development.ini |
|
1696 |
http_port=8080``. See https://github.com/Pylons/pyramid/pull/714 |
|
1697 |
|
|
1698 |
- A somewhat advanced and obscure feature of Pyramid event handlers is their |
|
1699 |
ability to handle "multi-interface" notifications. These notifications have |
|
1700 |
traditionally presented multiple objects to the subscriber callable. For |
|
1701 |
instance, if an event was sent by code like this:: |
|
1702 |
|
|
1703 |
registry.notify(event, context) |
|
1704 |
|
|
1705 |
In the past, in order to catch such an event, you were obligated to write and |
|
1706 |
register an event subscriber that mentioned both the event and the context in |
|
1707 |
its argument list:: |
|
1708 |
|
|
1709 |
@subscriber([SomeEvent, SomeContextType]) |
|
1710 |
def asubscriber(event, context): |
|
1711 |
pass |
|
1712 |
|
|
1713 |
In many subscriber callables registered this way, it was common for the logic |
|
1714 |
in the subscriber callable to completely ignore the second and following |
|
1715 |
arguments (e.g. ``context`` in the above example might be ignored), because |
|
1716 |
they usually existed as attributes of the event anyway. You could usually |
|
1717 |
get the same value by doing ``event.context`` or similar. |
|
1718 |
|
|
1719 |
The fact that you needed to put an extra argument which you usually ignored |
|
1720 |
in the subscriber callable body was only a minor annoyance until we added |
|
1721 |
"subscriber predicates", used to narrow the set of circumstances under which |
|
1722 |
a subscriber will be executed, in a prior 1.4 alpha release. Once those were |
|
1723 |
added, the annoyance was escalated, because subscriber predicates needed to |
|
1724 |
accept the same argument list and arity as the subscriber callables that they |
|
1725 |
were configured against. So, for example, if you had these two subscriber |
|
1726 |
registrations in your code:: |
|
1727 |
|
|
1728 |
@subscriber([SomeEvent, SomeContextType]) |
|
1729 |
def asubscriber(event, context): |
|
1730 |
pass |
|
1731 |
|
|
1732 |
@subscriber(SomeOtherEvent) |
|
1733 |
def asubscriber(event): |
|
1734 |
pass |
|
1735 |
|
|
1736 |
And you wanted to use a subscriber predicate:: |
|
1737 |
|
|
1738 |
@subscriber([SomeEvent, SomeContextType], mypredicate=True) |
|
1739 |
def asubscriber1(event, context): |
|
1740 |
pass |
|
1741 |
|
|
1742 |
@subscriber(SomeOtherEvent, mypredicate=True) |
|
1743 |
def asubscriber2(event): |
|
1744 |
pass |
|
1745 |
|
|
1746 |
If an existing ``mypredicate`` subscriber predicate had been written in such |
|
1747 |
a way that it accepted only one argument in its ``__call__``, you could not |
|
1748 |
use it against a subscription which named more than one interface in its |
|
1749 |
subscriber interface list. Similarly, if you had written a subscriber |
|
1750 |
predicate that accepted two arguments, you couldn't use it against a |
|
1751 |
registration that named only a single interface type. |
|
1752 |
|
|
1753 |
For example, if you created this predicate:: |
|
1754 |
|
|
1755 |
class MyPredicate(object): |
|
1756 |
# portions elided... |
|
1757 |
def __call__(self, event): |
|
1758 |
return self.val == event.context.foo |
|
1759 |
|
|
1760 |
It would not work against a multi-interface-registered subscription, so in |
|
1761 |
the above example, when you attempted to use it against ``asubscriber1``, it |
|
1762 |
would fail at runtime with a TypeError, claiming something was attempting to |
|
1763 |
call it with too many arguments. |
|
1764 |
|
|
1765 |
To hack around this limitation, you were obligated to design the |
|
1766 |
``mypredicate`` predicate to expect to receive in its ``__call__`` either a |
|
1767 |
single ``event`` argument (a SomeOtherEvent object) *or* a pair of arguments |
|
1768 |
(a SomeEvent object and a SomeContextType object), presumably by doing |
|
1769 |
something like this:: |
|
1770 |
|
|
1771 |
class MyPredicate(object): |
|
1772 |
# portions elided... |
|
1773 |
def __call__(self, event, context=None): |
|
1774 |
return self.val == event.context.foo |
|
1775 |
|
|
1776 |
This was confusing and bad. |
|
1777 |
|
|
1778 |
In order to allow people to ignore unused arguments to subscriber callables |
|
1779 |
and to normalize the relationship between event subscribers and subscriber |
|
1780 |
predicates, we now allow both subscribers and subscriber predicates to accept |
|
1781 |
only a single ``event`` argument even if they've been subscribed for |
|
1782 |
notifications that involve multiple interfaces. Subscribers and subscriber |
|
1783 |
predicates that accept only one argument will receive the first object passed |
|
1784 |
to ``notify``; this is typically (but not always) the event object. The |
|
1785 |
other objects involved in the subscription lookup will be discarded. You can |
|
1786 |
now write an event subscriber that accepts only ``event`` even if it |
|
1787 |
subscribes to multiple interfaces:: |
|
1788 |
|
|
1789 |
@subscriber([SomeEvent, SomeContextType]) |
|
1790 |
def asubscriber(event): |
|
1791 |
# this will work! |
|
1792 |
|
|
1793 |
This prevents you from needing to match the subscriber callable parameters to |
|
1794 |
the subscription type unnecessarily, especially when you don't make use of |
|
1795 |
any argument in your subscribers except for the event object itself. |
|
1796 |
|
|
1797 |
Note, however, that if the event object is not the first |
|
1798 |
object in the call to ``notify``, you'll run into trouble. For example, if |
|
1799 |
notify is called with the context argument first:: |
|
1800 |
|
|
1801 |
registry.notify(context, event) |
|
1802 |
|
|
1803 |
You won't be able to take advantage of the event-only feature. It will |
|
1804 |
"work", but the object received by your event handler won't be the event |
|
1805 |
object, it will be the context object, which won't be very useful:: |
|
1806 |
|
|
1807 |
@subscriber([SomeContextType, SomeEvent]) |
|
1808 |
def asubscriber(event): |
|
1809 |
# bzzt! you'll be getting the context here as ``event``, and it'll |
|
1810 |
# be useless |
|
1811 |
|
|
1812 |
Existing multiple-argument subscribers continue to work without issue, so you |
|
1813 |
should continue use those if your system notifies using multiple interfaces |
|
1814 |
and the first interface is not the event interface. For example:: |
|
1815 |
|
|
1816 |
@subscriber([SomeContextType, SomeEvent]) |
|
1817 |
def asubscriber(context, event): |
|
1818 |
# this will still work! |
|
1819 |
|
|
1820 |
The event-only feature makes it possible to use a subscriber predicate that |
|
1821 |
accepts only a request argument within both multiple-interface subscriber |
|
1822 |
registrations and single-interface subscriber registrations. You needn't |
|
1823 |
make slightly different variations of predicates depending on the |
|
1824 |
subscription type arguments. Instead, just write all your subscriber |
|
1825 |
predicates so they only accept ``event`` in their ``__call__`` and they'll be |
|
1826 |
useful across all registrations for subscriptions that use an event as their |
|
1827 |
first argument, even ones which accept more than just ``event``. |
|
1828 |
|
|
1829 |
However, the same caveat applies to predicates as to subscriber callables: if |
|
1830 |
you're subscribing to a multi-interface event, and the first interface is not |
|
1831 |
the event interface, the predicate won't work properly. In such a case, |
|
1832 |
you'll need to match the predicate ``__call__`` argument ordering and |
|
1833 |
composition to the ordering of the interfaces. For example, if the |
|
1834 |
registration for the subscription uses ``[SomeContext, SomeEvent]``, you'll |
|
1835 |
need to reflect that in the ordering of the parameters of the predicate's |
|
1836 |
``__call__`` method:: |
|
1837 |
|
|
1838 |
def __call__(self, context, event): |
|
1839 |
return event.request.path.startswith(self.val) |
|
1840 |
|
|
1841 |
tl;dr: 1) When using multi-interface subscriptions, always use the event type |
|
1842 |
as the first subscription registration argument and 2) When 1 is true, use |
|
1843 |
only ``event`` in your subscriber and subscriber predicate parameter lists, |
|
1844 |
no matter how many interfaces the subscriber is notified with. This |
|
1845 |
combination will result in the maximum amount of reusability of subscriber |
|
1846 |
predicates and the least amount of thought on your part. Drink responsibly. |
|
1847 |
|
|
1848 |
Bug Fixes |
|
1849 |
--------- |
|
1850 |
|
|
1851 |
- A failure when trying to locate the attribute ``__text__`` on route and view |
|
1852 |
predicates existed when the ``debug_routematch`` setting was true or when the |
|
1853 |
``pviews`` command was used. See https://github.com/Pylons/pyramid/pull/727 |
|
1854 |
|
|
1855 |
Documentation |
|
1856 |
------------- |
|
1857 |
|
|
1858 |
- Sync up tutorial source files with the files that are rendered by the |
|
1859 |
scaffold that each uses. |
|
1860 |
|
|
1861 |
1.4a4 (2012-11-14) |
|
1862 |
================== |
|
1863 |
|
|
1864 |
Features |
|
1865 |
-------- |
|
1866 |
|
|
1867 |
- ``pyramid.authentication.AuthTktAuthenticationPolicy`` has been updated to |
|
1868 |
support newer hashing algorithms such as ``sha512``. Existing applications |
|
1869 |
should consider updating if possible for improved security over the default |
|
1870 |
md5 hashing. |
|
1871 |
|
|
1872 |
- Added an ``effective_principals`` route and view predicate. |
|
1873 |
|
|
1874 |
- Do not allow the userid returned from the ``authenticated_userid`` or the |
|
1875 |
userid that is one of the list of principals returned by |
|
1876 |
``effective_principals`` to be either of the strings ``system.Everyone`` or |
|
1877 |
``system.Authenticated`` when any of the built-in authorization policies that |
|
1878 |
live in ``pyramid.authentication`` are in use. These two strings are |
|
1879 |
reserved for internal usage by Pyramid and they will not be accepted as valid |
|
1880 |
userids. |
|
1881 |
|
|
1882 |
- Slightly better debug logging from |
|
1883 |
``pyramid.authentication.RepozeWho1AuthenticationPolicy``. |
|
1884 |
|
|
1885 |
- ``pyramid.security.view_execution_permitted`` used to return ``True`` if no |
|
1886 |
view could be found. It now raises a ``TypeError`` exception in that case, as |
|
1887 |
it doesn't make sense to assert that a nonexistent view is |
|
1888 |
execution-permitted. See https://github.com/Pylons/pyramid/issues/299. |
|
1889 |
|
|
1890 |
- Allow a ``_depth`` argument to ``pyramid.view.view_config``, which will |
|
1891 |
permit limited composition reuse of the decorator by other software that |
|
1892 |
wants to provide custom decorators that are much like view_config. |
|
1893 |
|
|
1894 |
- Allow an iterable of decorators to be passed to |
|
1895 |
``pyramid.config.Configurator.add_view``. This allows views to be wrapped |
|
1896 |
by more than one decorator without requiring combining the decorators |
|
1897 |
yourself. |
|
1898 |
|
|
1899 |
Bug Fixes |
|
1900 |
--------- |
|
1901 |
|
|
1902 |
- In the past if a renderer returned ``None``, the body of the resulting |
|
1903 |
response would be set explicitly to the empty string. Instead, now, the body |
|
1904 |
is left unchanged, which allows the renderer to set a body itself by using |
|
1905 |
e.g. ``request.response.body = b'foo'``. The body set by the renderer will |
|
1906 |
be unmolested on the way out. See |
|
1907 |
https://github.com/Pylons/pyramid/issues/709 |
|
1908 |
|
|
1909 |
- In uncommon cases, the ``pyramid_excview_tween_factory`` might have |
|
1910 |
inadvertently raised a ``KeyError`` looking for ``request_iface`` as an |
|
1911 |
attribute of the request. It no longer fails in this case. See |
|
1912 |
https://github.com/Pylons/pyramid/issues/700 |
|
1913 |
|
|
1914 |
- Be more tolerant of potential error conditions in ``match_param`` and |
|
1915 |
``physical_path`` predicate implementations; instead of raising an exception, |
|
1916 |
return False. |
|
1917 |
|
|
1918 |
- ``pyramid.view.render_view`` was not functioning properly under Python 3.x |
|
1919 |
due to a byte/unicode discrepancy. See |
|
1920 |
https://github.com/Pylons/pyramid/issues/721 |
|
1921 |
|
|
1922 |
Deprecations |
|
1923 |
------------ |
|
1924 |
|
|
1925 |
- ``pyramid.authentication.AuthTktAuthenticationPolicy`` will emit a warning if |
|
1926 |
an application is using the policy without explicitly passing a ``hashalg`` |
|
1927 |
argument. This is because the default is "md5" which is considered |
|
1928 |
theoretically subject to collision attacks. If you really want "md5" then you |
|
1929 |
must specify it explicitly to get rid of the warning. |
|
1930 |
|
|
1931 |
Documentation |
|
1932 |
------------- |
|
1933 |
|
|
1934 |
- All of the tutorials that use |
|
1935 |
``pyramid.authentication.AuthTktAuthenticationPolicy`` now explicitly pass |
|
1936 |
``sha512`` as a ``hashalg`` argument. |
|
1937 |
|
|
1938 |
|
|
1939 |
Internals |
|
1940 |
--------- |
|
1941 |
|
|
1942 |
- Move ``TopologicalSorter`` from ``pyramid.config.util`` to ``pyramid.util``, |
|
1943 |
move ``CyclicDependencyError`` from ``pyramid.config.util`` to |
|
1944 |
``pyramid.exceptions``, rename ``Singleton`` to ``Sentinel`` and move from |
|
1945 |
``pyramid.config.util`` to ``pyramid.util``; this is in an effort to |
|
1946 |
move that stuff that may be an API one day out of ``pyramid.config.util``, |
|
1947 |
because that package should never be imported from non-Pyramid code. |
|
1948 |
TopologicalSorter is still not an API, but may become one. |
|
1949 |
|
|
1950 |
- Get rid of shady monkeypatching of ``pyramid.request.Request`` and |
|
1951 |
``pyramid.response.Response`` done within the ``__init__.py`` of Pyramid. |
|
1952 |
Webob no longer relies on this being done. Instead, the ResponseClass |
|
1953 |
attribute of the Pyramid Request class is assigned to the Pyramid response |
|
1954 |
class; that's enough to satisfy WebOb and behave as it did before with the |
|
1955 |
monkeypatching. |
|
1956 |
|
|
1957 |
1.4a3 (2012-10-26) |
|
1958 |
================== |
|
1959 |
|
|
1960 |
Bug Fixes |
|
1961 |
--------- |
|
1962 |
|
|
1963 |
- The match_param predicate's text method was fixed to sort its values. |
|
1964 |
Part of https://github.com/Pylons/pyramid/pull/705 |
|
1965 |
|
|
1966 |
- 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series |
|
1967 |
function of same name. In particular, if passed a request, it would not |
|
1968 |
set the ``registry`` attribute of the request like 1.3 did. A symptom |
|
1969 |
would be that passing a request to ``pyramid.paster.bootstrap`` (which uses |
|
1970 |
the function) that did not have a ``registry`` attribute could assume that |
|
1971 |
the registry would be attached to the request by Pyramid. This assumption |
|
1972 |
could be made in 1.3, but not in 1.4. The assumption can now be made in |
|
1973 |
1.4 too (a registry is attached to a request passed to bootstrap or |
|
1974 |
prepare). |
|
1975 |
|
|
1976 |
- When registering a view configuration that named a Chameleon ZPT renderer |
|
1977 |
with a macro name in it (e.g. ``renderer='some/template#somemacro.pt``) as |
|
1978 |
well as a view configuration without a macro name in it that pointed to the |
|
1979 |
same template (e.g. ``renderer='some/template.pt'``), internal caching could |
|
1980 |
confuse the two, and your code might have rendered one instead of the |
|
1981 |
other. |
|
1982 |
|
|
1983 |
Features |
|
1984 |
-------- |
|
1985 |
|
|
1986 |
- Allow multiple values to be specified to the ``request_param`` view/route |
|
1987 |
predicate as a sequence. Previously only a single string value was allowed. |
|
1988 |
See https://github.com/Pylons/pyramid/pull/705 |
|
1989 |
|
|
1990 |
- Comments with references to documentation sections placed in scaffold |
|
1991 |
``.ini`` files. |
|
1992 |
|
|
1993 |
- Added an HTTP Basic authentication policy |
|
1994 |
at ``pyramid.authentication.BasicAuthAuthenticationPolicy``. |
|
1995 |
|
|
1996 |
- The Configurator ``testing_securitypolicy`` method now returns the policy |
|
1997 |
object it creates. |
|
1998 |
|
|
1999 |
- The Configurator ``testing_securitypolicy`` method accepts two new |
|
2000 |
arguments: ``remember_result`` and ``forget_result``. If supplied, these |
|
2001 |
values influence the result of the policy's ``remember`` and ``forget`` |
|
2002 |
methods, respectively. |
|
2003 |
|
|
2004 |
- The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a |
|
2005 |
``forgotten`` value on the policy (the value ``True``) when its ``forget`` |
|
2006 |
method is called. |
|
2007 |
|
|
2008 |
- The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a |
|
2009 |
``remembered`` value on the policy, which is the value of the ``principal`` |
|
2010 |
argument it's called with when its ``remember`` method is called. |
|
2011 |
|
|
2012 |
- New ``physical_path`` view predicate. If specified, this value should be a |
|
2013 |
string or a tuple representing the physical traversal path of the context |
|
2014 |
found via traversal for this predicate to match as true. For example: |
|
2015 |
``physical_path='/'`` or ``physical_path='/a/b/c'`` or ``physical_path=('', |
|
2016 |
'a', 'b', 'c')``. This is not a path prefix match or a regex, it's a |
|
2017 |
whole-path match. It's useful when you want to always potentially show a |
|
2018 |
view when some object is traversed to, but you can't be sure about what kind |
|
2019 |
of object it will be, so you can't use the ``context`` predicate. The |
|
2020 |
individual path elements inbetween slash characters or in tuple elements |
|
2021 |
should be the Unicode representation of the name of the resource and should |
|
2022 |
not be encoded in any way. |
|
2023 |
|
|
2024 |
1.4a2 (2012-09-27) |
|
2025 |
================== |
|
2026 |
|
|
2027 |
Bug Fixes |
|
2028 |
--------- |
|
2029 |
|
|
2030 |
- When trying to determine Mako defnames and Chameleon macro names in asset |
|
2031 |
specifications, take into account that the filename may have a hyphen in |
|
2032 |
it. See https://github.com/Pylons/pyramid/pull/692 |
|
2033 |
|
|
2034 |
Features |
|
2035 |
-------- |
|
2036 |
|
|
2037 |
- A new ``pyramid.session.check_csrf_token`` convenience function was added. |
|
2038 |
|
|
2039 |
- A ``check_csrf`` view predicate was added. For example, you can now do |
|
2040 |
``config.add_view(someview, check_csrf=True)``. When the predicate is |
|
2041 |
checked, if the ``csrf_token`` value in ``request.params`` matches the CSRF |
|
2042 |
token in the request's session, the view will be permitted to execute. |
|
2043 |
Otherwise, it will not be permitted to execute. |
|
2044 |
|
|
2045 |
- Add ``Base.metadata.bind = engine`` to alchemy template, so that tables |
|
2046 |
defined imperatively will work. |
|
2047 |
|
|
2048 |
Documentation |
|
2049 |
------------- |
|
2050 |
|
|
2051 |
- update wiki2 SQLA tutorial with the changes required after inserting |
|
2052 |
``Base.metadata.bind = engine`` into the alchemy scaffold. |
|
2053 |
|
|
2054 |
1.4a1 (2012-09-16) |
|
2055 |
================== |
|
2056 |
|
|
2057 |
Bug Fixes |
|
2058 |
--------- |
|
2059 |
|
|
2060 |
- Forward port from 1.3 branch: When no authentication policy was configured, |
|
2061 |
a call to ``pyramid.security.effective_principals`` would unconditionally |
|
2062 |
return the empty list. This was incorrect, it should have unconditionally |
|
2063 |
returned ``[Everyone]``, and now does. |
|
2064 |
|
|
2065 |
- Explicit url dispatch regexes can now contain colons. |
|
2066 |
https://github.com/Pylons/pyramid/issues/629 |
|
2067 |
|
|
2068 |
- On at least one 64-bit Ubuntu system under Python 3.2, using the |
|
2069 |
``view_config`` decorator caused a ``RuntimeError: dictionary changed size |
|
2070 |
during iteration`` exception. It no longer does. See |
|
2071 |
https://github.com/Pylons/pyramid/issues/635 for more information. |
|
2072 |
|
|
2073 |
- In Mako Templates lookup, check if the uri is already adjusted and bring |
|
2074 |
it back to an asset spec. Normally occurs with inherited templates or |
|
2075 |
included components. |
|
2076 |
https://github.com/Pylons/pyramid/issues/606 |
|
2077 |
https://github.com/Pylons/pyramid/issues/607 |
|
2078 |
|
|
2079 |
- In Mako Templates lookup, check for absolute uri (using mako directories) |
|
2080 |
when mixing up inheritance with asset specs. |
|
2081 |
https://github.com/Pylons/pyramid/issues/662 |
|
2082 |
|
|
2083 |
- HTTP Accept headers were not being normalized causing potentially |
|
2084 |
conflicting view registrations to go unnoticed. Two views that only |
|
2085 |
differ in the case ('text/html' vs. 'text/HTML') will now raise an error. |
|
2086 |
https://github.com/Pylons/pyramid/pull/620 |
|
2087 |
|
|
2088 |
- Forward-port from 1.3 branch: when registering multiple views with an |
|
2089 |
``accept`` predicate in a Pyramid application runing under Python 3, you |
|
2090 |
might have received a ``TypeError: unorderable types: function() < |
|
2091 |
function()`` exception. |
|
2092 |
|
|
2093 |
Features |
|
2094 |
-------- |
|
2095 |
|
169dba
|
2096 |
- Python 3.3 compatibility. |
SP |
2097 |
|
4a86b2
|
2098 |
- Configurator.add_directive now accepts arbitrary callables like partials or |
CM |
2099 |
objects implementing ``__call__`` which dont have ``__name__`` and |
|
2100 |
``__doc__`` attributes. See https://github.com/Pylons/pyramid/issues/621 |
|
2101 |
and https://github.com/Pylons/pyramid/pull/647. |
|
2102 |
|
|
2103 |
- Third-party custom view, route, and subscriber predicates can now be added |
|
2104 |
for use by view authors via |
|
2105 |
``pyramid.config.Configurator.add_view_predicate``, |
|
2106 |
``pyramid.config.Configurator.add_route_predicate`` and |
|
2107 |
``pyramid.config.Configurator.add_subscriber_predicate``. So, for example, |
|
2108 |
doing this:: |
|
2109 |
|
|
2110 |
config.add_view_predicate('abc', my.package.ABCPredicate) |
|
2111 |
|
|
2112 |
Might allow a view author to do this in an application that configured that |
|
2113 |
predicate:: |
|
2114 |
|
|
2115 |
@view_config(abc=1) |
|
2116 |
|
|
2117 |
Similar features exist for ``add_route``, and ``add_subscriber``. See |
|
2118 |
"Adding A Third Party View, Route, or Subscriber Predicate" in the Hooks |
|
2119 |
chapter for more information. |
|
2120 |
|
|
2121 |
Note that changes made to support the above feature now means that only |
|
2122 |
actions registered using the same "order" can conflict with one another. |
|
2123 |
It used to be the case that actions registered at different orders could |
|
2124 |
potentially conflict, but to my knowledge nothing ever depended on this |
|
2125 |
behavior (it was a bit silly). |
|
2126 |
|
|
2127 |
- Custom objects can be made easily JSON-serializable in Pyramid by defining |
|
2128 |
a ``__json__`` method on the object's class. This method should return |
|
2129 |
values natively serializable by ``json.dumps`` (such as ints, lists, |
|
2130 |
dictionaries, strings, and so forth). |
|
2131 |
|
|
2132 |
- The JSON renderer now allows for the definition of custom type adapters to |
|
2133 |
convert unknown objects to JSON serializations. |
|
2134 |
|
|
2135 |
- As of this release, the ``request_method`` predicate, when used, will also |
|
2136 |
imply that ``HEAD`` is implied when you use ``GET``. For example, using |
|
2137 |
``@view_config(request_method='GET')`` is equivalent to using |
|
2138 |
``@view_config(request_method=('GET', 'HEAD'))``. Using |
|
2139 |
``@view_config(request_method=('GET', 'POST')`` is equivalent to using |
|
2140 |
``@view_config(request_method=('GET', 'HEAD', 'POST')``. This is because |
|
2141 |
HEAD is a variant of GET that omits the body, and WebOb has special support |
|
2142 |
to return an empty body when a HEAD is used. |
|
2143 |
|
|
2144 |
- ``config.add_request_method`` has been introduced to support extending |
|
2145 |
request objects with arbitrary callables. This method expands on the |
|
2146 |
previous ``config.set_request_property`` by supporting methods as well as |
|
2147 |
properties. This method now causes less code to be executed at |
|
2148 |
request construction time than ``config.set_request_property`` in |
|
2149 |
version 1.3. |
|
2150 |
|
|
2151 |
- Don't add a ``?`` to URLs generated by ``request.resource_url`` if the |
|
2152 |
``query`` argument is provided but empty. |
|
2153 |
|
|
2154 |
- Don't add a ``?`` to URLs generated by ``request.route_url`` if the |
|
2155 |
``_query`` argument is provided but empty. |
|
2156 |
|
|
2157 |
- The static view machinery now raises (rather than returns) ``HTTPNotFound`` |
|
2158 |
and ``HTTPMovedPermanently`` exceptions, so these can be caught by the |
|
2159 |
Not Found View (and other exception views). |
|
2160 |
|
|
2161 |
- The Mako renderer now supports a def name in an asset spec. When the def |
|
2162 |
name is present in the asset spec, the system will render the template def |
|
2163 |
within the template and will return the result. An example asset spec is |
|
2164 |
``package:path/to/template#defname.mako``. This will render the def named |
|
2165 |
``defname`` inside the ``template.mako`` template instead of rendering the |
|
2166 |
entire template. The old way of returning a tuple in the form |
|
2167 |
``('defname', {})`` from the view is supported for backward compatibility, |
|
2168 |
|
|
2169 |
- The Chameleon ZPT renderer now accepts a macro name in an asset spec. When |
|
2170 |
the macro name is present in the asset spec, the system will render the |
|
2171 |
macro listed as a ``define-macro`` and return the result instead of |
|
2172 |
rendering the entire template. An example asset spec: |
|
2173 |
``package:path/to/template#macroname.pt``. This will render the macro |
|
2174 |
defined as ``macroname`` within the ``template.pt`` template instead of the |
|
2175 |
entire templae. |
|
2176 |
|
|
2177 |
- When there is a predicate mismatch exception (seen when no view matches for |
|
2178 |
a given request due to predicates not working), the exception now contains |
|
2179 |
a textual description of the predicate which didn't match. |
|
2180 |
|
|
2181 |
- An ``add_permission`` directive method was added to the Configurator. This |
|
2182 |
directive registers a free-standing permission introspectable into the |
|
2183 |
Pyramid introspection system. Frameworks built atop Pyramid can thus use |
|
2184 |
the ``permissions`` introspectable category data to build a |
|
2185 |
comprehensive list of permissions supported by a running system. Before |
|
2186 |
this method was added, permissions were already registered in this |
|
2187 |
introspectable category as a side effect of naming them in an ``add_view`` |
|
2188 |
call, this method just makes it possible to arrange for a permission to be |
|
2189 |
put into the ``permissions`` introspectable category without naming it |
|
2190 |
along with an associated view. Here's an example of usage of |
|
2191 |
``add_permission``:: |
|
2192 |
|
|
2193 |
config = Configurator() |
|
2194 |
config.add_permission('view') |
|
2195 |
|
|
2196 |
- The ``UnencryptedCookieSessionFactoryConfig`` now accepts |
|
2197 |
``signed_serialize`` and ``signed_deserialize`` hooks which may be used |
|
2198 |
to influence how the sessions are marshalled (by default this is done |
|
2199 |
with HMAC+pickle). |
|
2200 |
|
|
2201 |
- ``pyramid.testing.DummyRequest`` now supports methods supplied by the |
|
2202 |
``pyramid.util.InstancePropertyMixin`` class such as ``set_property``. |
|
2203 |
|
|
2204 |
- Request properties and methods added via ``config.set_request_property`` or |
|
2205 |
``config.add_request_method`` are now available to tweens. |
|
2206 |
|
|
2207 |
- Request properties and methods added via ``config.set_request_property`` or |
|
2208 |
``config.add_request_method`` are now available in the request object |
|
2209 |
returned from ``pyramid.paster.bootstrap``. |
|
2210 |
|
|
2211 |
- ``request.context`` of environment request during ``bootstrap`` is now the |
|
2212 |
root object if a context isn't already set on a provided request. |
|
2213 |
|
|
2214 |
- The ``pyramid.decorator.reify`` function is now an API, and was added to |
|
2215 |
the API documentation. |
|
2216 |
|
|
2217 |
- Added the ``pyramid.testing.testConfig`` context manager, which can be used |
|
2218 |
to generate a configurator in a test, e.g. ``with testing.testConfig(...):``. |
|
2219 |
|
|
2220 |
- Users can now invoke a subrequest from within view code using a new |
|
2221 |
``request.invoke_subrequest`` API. |
|
2222 |
|
|
2223 |
Deprecations |
|
2224 |
------------ |
|
2225 |
|
|
2226 |
- The ``pyramid.config.Configurator.set_request_property`` has been |
|
2227 |
documentation-deprecated. The method remains usable but the more |
|
2228 |
featureful ``pyramid.config.Configurator.add_request_method`` should be |
|
2229 |
used in its place (it has all of the same capabilities but can also extend |
|
2230 |
the request object with methods). |
|
2231 |
|
|
2232 |
Backwards Incompatibilities |
|
2233 |
--------------------------- |
|
2234 |
|
|
2235 |
- The Pyramid router no longer adds the values ``bfg.routes.route`` or |
|
2236 |
``bfg.routes.matchdict`` to the request's WSGI environment dictionary. |
|
2237 |
These values were docs-deprecated in ``repoze.bfg`` 1.0 (effectively seven |
|
2238 |
minor releases ago). If your code depended on these values, use |
|
2239 |
request.matched_route and request.matchdict instead. |
|
2240 |
|
|
2241 |
- It is no longer possible to pass an environ dictionary directly to |
|
2242 |
``pyramid.traversal.ResourceTreeTraverser.__call__`` (aka |
|
2243 |
``ModelGraphTraverser.__call__``). Instead, you must pass a request |
|
2244 |
object. Passing an environment instead of a request has generated a |
|
2245 |
deprecation warning since Pyramid 1.1. |
|
2246 |
|
|
2247 |
- Pyramid will no longer work properly if you use the |
|
2248 |
``webob.request.LegacyRequest`` as a request factory. Instances of the |
|
2249 |
LegacyRequest class have a ``request.path_info`` which return a string. |
|
2250 |
This Pyramid release assumes that ``request.path_info`` will |
|
2251 |
unconditionally be Unicode. |
|
2252 |
|
|
2253 |
- The functions from ``pyramid.chameleon_zpt`` and ``pyramid.chameleon_text`` |
|
2254 |
named ``get_renderer``, ``get_template``, ``render_template``, and |
|
2255 |
``render_template_to_response`` have been removed. These have issued a |
|
2256 |
deprecation warning upon import since Pyramid 1.0. Use |
|
2257 |
``pyramid.renderers.get_renderer()``, |
|
2258 |
``pyramid.renderers.get_renderer().implementation()``, |
|
2259 |
``pyramid.renderers.render()`` or ``pyramid.renderers.render_to_response`` |
|
2260 |
respectively instead of these functions. |
|
2261 |
|
|
2262 |
- The ``pyramid.configuration`` module was removed. It had been deprecated |
|
2263 |
since Pyramid 1.0 and printed a deprecation warning upon its use. Use |
|
2264 |
``pyramid.config`` instead. |
|
2265 |
|
|
2266 |
- The ``pyramid.paster.PyramidTemplate`` API was removed. It had been |
|
2267 |
deprecated since Pyramid 1.1 and issued a warning on import. If your code |
|
2268 |
depended on this, adjust your code to import |
|
2269 |
``pyramid.scaffolds.PyramidTemplate`` instead. |
|
2270 |
|
|
2271 |
- The ``pyramid.settings.get_settings()`` API was removed. It had been |
|
2272 |
printing a deprecation warning since Pyramid 1.0. If your code depended on |
|
2273 |
this API, use ``pyramid.threadlocal.get_current_registry().settings`` |
|
2274 |
instead or use the ``settings`` attribute of the registry available from |
|
2275 |
the request (``request.registry.settings``). |
|
2276 |
|
|
2277 |
- These APIs from the ``pyramid.testing`` module were removed. They have |
|
2278 |
been printing deprecation warnings since Pyramid 1.0: |
|
2279 |
|
|
2280 |
* ``registerDummySecurityPolicy``, use |
|
2281 |
``pyramid.config.Configurator.testing_securitypolicy`` instead. |
|
2282 |
|
|
2283 |
* ``registerResources`` (aka ``registerModels``, use |
|
2284 |
``pyramid.config.Configurator.testing_resources`` instead. |
|
2285 |
|
|
2286 |
* ``registerEventListener``, use |
|
2287 |
``pyramid.config.Configurator.testing_add_subscriber`` instead. |
|
2288 |
|
|
2289 |
* ``registerTemplateRenderer`` (aka `registerDummyRenderer``), use |
|
2290 |
``pyramid.config.Configurator.testing_add_template`` instead. |
|
2291 |
|
|
2292 |
* ``registerView``, use ``pyramid.config.Configurator.add_view`` instead. |
|
2293 |
|
|
2294 |
* ``registerUtility``, use |
|
2295 |
``pyramid.config.Configurator.registry.registerUtility`` instead. |
|
2296 |
|
|
2297 |
* ``registerAdapter``, use |
|
2298 |
``pyramid.config.Configurator.registry.registerAdapter`` instead. |
|
2299 |
|
|
2300 |
* ``registerSubscriber``, use |
|
2301 |
``pyramid.config.Configurator.add_subscriber`` instead. |
|
2302 |
|
|
2303 |
* ``registerRoute``, use |
|
2304 |
``pyramid.config.Configurator.add_route`` instead. |
|
2305 |
|
|
2306 |
* ``registerSettings``, use |
|
2307 |
``pyramid.config.Configurator.add_settings`` instead. |
|
2308 |
|
|
2309 |
- In Pyramid 1.3 and previous, the ``__call__`` method of a Response object |
|
2310 |
was invoked before any finished callbacks were executed. As of this |
|
2311 |
release, the ``__call__`` method of a Response object is invoked *after* |
|
2312 |
finished callbacks are executed. This is in support of the |
|
2313 |
``request.invoke_subrequest`` feature. |
|
2314 |
|
|
2315 |
- The 200-series exception responses named ``HTTPCreated``, ``HTTPAccepted``, |
|
2316 |
``HTTPNonAuthoritativeInformation``, ``HTTPNoContent``, ``HTTPResetContent``, |
|
2317 |
and ``HTTPPartialContent`` in ``pyramid.httpexceptions`` no longer inherit |
|
2318 |
from ``HTTPOk``. Instead they inherit from a new base class named |
|
2319 |
``HTTPSuccessful``. This will have no effect on you unless you've registered |
|
2320 |
an exception view for ``HTTPOk`` and expect that exception view to |
|
2321 |
catch all the aforementioned exceptions. |
|
2322 |
|
|
2323 |
Documentation |
|
2324 |
------------- |
|
2325 |
|
|
2326 |
- Added an "Upgrading Pyramid" chapter to the narrative documentation. It |
|
2327 |
describes how to cope with deprecations and removals of Pyramid APIs and |
|
2328 |
how to show Pyramid-generated deprecation warnings while running tests and |
|
2329 |
while running a server. |
|
2330 |
|
|
2331 |
- Added a "Invoking a Subrequest" chapter to the documentation. It describes |
|
2332 |
how to use the new ``request.invoke_subrequest`` API. |
|
2333 |
|
|
2334 |
Dependencies |
|
2335 |
------------ |
|
2336 |
|
|
2337 |
- Pyramid now requires WebOb 1.2b3+ (the prior Pyramid release only relied on |
|
2338 |
1.2dev+). This is to ensure that we obtain a version of WebOb that returns |
|
2339 |
``request.path_info`` as text. |
|
2340 |
|
2c949d
|
2341 |
1.3 (2012-03-21) |
CM |
2342 |
================ |
|
2343 |
|
|
2344 |
Bug Fixes |
|
2345 |
--------- |
|
2346 |
|
|
2347 |
- When ``pyramid.wsgi.wsgiapp2`` calls the downstream WSGI app, the app's |
|
2348 |
environ will no longer have (deprecated and potentially misleading) |
|
2349 |
``bfg.routes.matchdict`` or ``bfg.routes.route`` keys in it. A symptom of |
|
2350 |
this bug would be a ``wsgiapp2``-wrapped Pyramid app finding the wrong view |
|
2351 |
because it mistakenly detects that a route was matched when, in fact, it |
|
2352 |
was not. |
|
2353 |
|
|
2354 |
- The fix for issue https://github.com/Pylons/pyramid/issues/461 (which made |
|
2355 |
it possible for instance methods to be used as view callables) introduced a |
|
2356 |
backwards incompatibility when methods that declared only a request |
|
2357 |
argument were used. See https://github.com/Pylons/pyramid/issues/503 |
|
2358 |
|
|
2359 |
1.3b3 (2012-03-17) |
|
2360 |
================== |
|
2361 |
|
|
2362 |
Bug Fixes |
|
2363 |
--------- |
|
2364 |
|
|
2365 |
- ``config.add_view(<aninstancemethod>)`` raised AttributeError involving |
|
2366 |
``__text__``. See https://github.com/Pylons/pyramid/issues/461 |
|
2367 |
|
|
2368 |
- Remove references to do-nothing ``pyramid.debug_templates`` setting in all |
|
2369 |
Pyramid-provided ``.ini`` files. This setting previously told Chameleon to |
|
2370 |
render better exceptions; now Chameleon always renders nice exceptions |
|
2371 |
regardless of the value of this setting. |
|
2372 |
|
|
2373 |
Scaffolds |
|
2374 |
--------- |
|
2375 |
|
|
2376 |
- The ``alchemy`` scaffold now shows an informative error message in the |
|
2377 |
browser if the person creating the project forgets to run the |
|
2378 |
initialization script. |
|
2379 |
|
|
2380 |
- The ``alchemy`` scaffold initialization script is now called |
|
2381 |
``initialize_<projectname>_db`` instead of ``populate_<projectname>``. |
|
2382 |
|
|
2383 |
Documentation |
|
2384 |
------------- |
|
2385 |
|
|
2386 |
- Wiki tutorials improved due to collaboration at PyCon US 2012 sprints. |
|
2387 |
|
|
2388 |
1.3b2 (2012-03-02) |
|
2389 |
================== |
|
2390 |
|
|
2391 |
Bug Fixes |
|
2392 |
--------- |
|
2393 |
|
|
2394 |
- The method ``pyramid.request.Request.partial_application_url`` is no longer |
|
2395 |
in the API docs. It was meant to be a private method; its publication in |
|
2396 |
the documentation as an API method was a mistake, and it has been renamed |
|
2397 |
to something private. |
|
2398 |
|
|
2399 |
- When a static view was registered using an absolute filesystem path on |
|
2400 |
Windows, the ``request.static_url`` function did not work to generate URLs |
|
2401 |
to its resources. Symptom: "No static URL definition matching |
|
2402 |
c:\\foo\\bar\\baz". |
|
2403 |
|
|
2404 |
- Make all tests pass on Windows XP. |
|
2405 |
|
|
2406 |
- Bug in ACL authentication checking on Python 3: the ``permits`` and |
|
2407 |
``principals_allowed_by_permission`` method of |
|
2408 |
``pyramid.authorization.ACLAuthenticationPolicy`` could return an |
|
2409 |
inappropriate ``True`` value when a permission on an ACL was a string |
|
2410 |
rather than a sequence, and then only if the ACL permission string was a |
|
2411 |
substring of the ``permission`` value passed to the function. |
|
2412 |
|
|
2413 |
This bug effects no Pyramid deployment under Python 2; it is a bug that |
|
2414 |
exists only in deployments running on Python 3. It has existed since |
|
2415 |
Pyramid 1.3a1. |
|
2416 |
|
|
2417 |
This bug was due to the presence of an ``__iter__`` attribute on strings |
|
2418 |
under Python 3 which is not present under strings in Python 2. |
|
2419 |
|
|
2420 |
1.3b1 (2012-02-26) |
|
2421 |
================== |
|
2422 |
|
|
2423 |
Bug Fixes |
|
2424 |
--------- |
|
2425 |
|
|
2426 |
- ``pyramid.config.Configurator.with_package`` didn't work if the |
|
2427 |
Configurator was an old-style ``pyramid.configuration.Configurator`` |
|
2428 |
instance. |
|
2429 |
|
|
2430 |
- Pyramid authorization policies did not show up in the introspector. |
|
2431 |
|
|
2432 |
Deprecations |
|
2433 |
------------ |
|
2434 |
|
|
2435 |
- All references to the ``tmpl_context`` request variable were removed from |
|
2436 |
the docs. Its existence in Pyramid is confusing for people who were never |
|
2437 |
Pylons users. It was added as a porting convenience for Pylons users in |
|
2438 |
Pyramid 1.0, but it never caught on because the Pyramid rendering system is |
|
2439 |
a lot different than Pylons' was, and alternate ways exist to do what it |
|
2440 |
was designed to offer in Pylons. It will continue to exist "forever" but |
|
2441 |
it will not be recommended or mentioned in the docs. |
|
2442 |
|
|
2443 |
1.3a9 (2012-02-22) |
|
2444 |
================== |
|
2445 |
|
|
2446 |
Features |
|
2447 |
-------- |
|
2448 |
|
|
2449 |
- Add an ``introspection`` boolean to the Configurator constructor. If this |
|
2450 |
is ``True``, actions registered using the Configurator will be registered |
|
2451 |
with the introspector. If it is ``False``, they won't. The default is |
|
2452 |
``True``. Setting it to ``False`` during action processing will prevent |
|
2453 |
introspection for any following registration statements, and setting it to |
|
2454 |
``True`` will start them up again. This addition is to service a |
|
2455 |
requirement that the debug toolbar's own views and methods not show up in |
|
2456 |
the introspector. |
|
2457 |
|
|
2458 |
- New API: ``pyramid.config.Configurator.add_notfound_view``. This is a |
|
2459 |
wrapper for ``pyramid.Config.configurator.add_view`` which provides easy |
|
2460 |
append_slash support and does the right thing about permissions. It should |
|
2461 |
be preferred over calling ``add_view`` directly with |
|
2462 |
``context=HTTPNotFound`` as was previously recommended. |
|
2463 |
|
|
2464 |
- New API: ``pyramid.view.notfound_view_config``. This is a decorator |
|
2465 |
constructor like ``pyramid.view.view_config`` that calls |
|
2466 |
``pyramid.config.Configurator.add_notfound_view`` when scanned. It should |
|
2467 |
be preferred over using ``pyramid.view.view_config`` with |
|
2468 |
``context=HTTPNotFound`` as was previously recommended. |
|
2469 |
|
|
2470 |
- New API: ``pyramid.config.Configurator.add_forbidden_view``. This is a |
|
2471 |
wrapper for ``pyramid.Config.configurator.add_view`` which does the right |
|
2472 |
thing about permissions. It should be preferred over calling ``add_view`` |
|
2473 |
directly with ``context=HTTPForbidden`` as was previously recommended. |
|
2474 |
|
|
2475 |
- New API: ``pyramid.view.forbidden_view_config``. This is a decorator |
|
2476 |
constructor like ``pyramid.view.view_config`` that calls |
|
2477 |
``pyramid.config.Configurator.add_forbidden_view`` when scanned. It should |
|
2478 |
be preferred over using ``pyramid.view.view_config`` with |
|
2479 |
``context=HTTPForbidden`` as was previously recommended. |
|
2480 |
|
|
2481 |
- New APIs: ``pyramid.response.FileResponse`` and |
|
2482 |
``pyramid.response.FileIter``, for usage in views that must serve files |
|
2483 |
"manually". |
|
2484 |
|
|
2485 |
Backwards Incompatibilities |
|
2486 |
--------------------------- |
|
2487 |
|
|
2488 |
- Remove ``pyramid.config.Configurator.with_context`` class method. It was |
|
2489 |
never an API, it is only used by ``pyramid_zcml`` and its functionality has |
|
2490 |
been moved to that package's latest release. This means that you'll need |
|
2491 |
to use the 0.9.2 or later release of ``pyramid_zcml`` with this release of |
|
2492 |
Pyramid. |
|
2493 |
|
|
2494 |
- The ``introspector`` argument to the ``pyramid.config.Configurator`` |
|
2495 |
constructor API has been removed. It has been replaced by the boolean |
|
2496 |
``introspection`` flag. |
|
2497 |
|
|
2498 |
- The ``pyramid.registry.noop_introspector`` API object has been removed. |
|
2499 |
|
|
2500 |
- The older deprecated ``set_notfound_view`` Configurator method is now an |
|
2501 |
alias for the new ``add_notfound_view`` Configurator method. Likewise, the |
|
2502 |
older deprecated ``set_forbidden_view`` is now an alias for the new |
|
2503 |
``add_forbidden_view``. This has the following impact: the ``context`` sent |
|
2504 |
to views with a ``(context, request)`` call signature registered via the |
|
2505 |
``set_notfound_view`` or ``set_forbidden_view`` will now be an exception |
|
2506 |
object instead of the actual resource context found. Use |
|
2507 |
``request.context`` to get the actual resource context. It's also |
|
2508 |
recommended to disuse ``set_notfound_view`` in favor of |
|
2509 |
``add_notfound_view``, and disuse ``set_forbidden_view`` in favor of |
|
2510 |
``add_forbidden_view`` despite the aliasing. |
|
2511 |
|
|
2512 |
Deprecations |
|
2513 |
------------ |
|
2514 |
|
|
2515 |
- The API documentation for ``pyramid.view.append_slash_notfound_view`` and |
|
2516 |
``pyramid.view.AppendSlashNotFoundViewFactory`` was removed. These names |
|
2517 |
still exist and are still importable, but they are no longer APIs. Use |
|
2518 |
``pyramid.config.Configurator.add_notfound_view(append_slash=True)`` or |
|
2519 |
``pyramid.view.notfound_view_config(append_slash=True)`` to get the same |
|
2520 |
behavior. |
|
2521 |
|
|
2522 |
- The ``set_forbidden_view`` and ``set_notfound_view`` methods of the |
|
2523 |
Configurator were removed from the documentation. They have been |
|
2524 |
deprecated since Pyramid 1.1. |
|
2525 |
|
|
2526 |
Bug Fixes |
|
2527 |
--------- |
|
2528 |
|
|
2529 |
- The static file response object used by ``config.add_static_view`` opened |
|
2530 |
the static file twice, when it only needed to open it once. |
|
2531 |
|
|
2532 |
- The AppendSlashNotFoundViewFactory used request.path to match routes. This |
|
2533 |
was wrong because request.path contains the script name, and this would |
|
2534 |
cause it to fail in circumstances where the script name was not empty. It |
|
2535 |
should have used request.path_info, and now does. |
|
2536 |
|
|
2537 |
Documentation |
|
2538 |
------------- |
|
2539 |
|
|
2540 |
- Updated the "Creating a Not Found View" section of the "Hooks" chapter, |
|
2541 |
replacing explanations of registering a view using ``add_view`` or |
|
2542 |
``view_config`` with ones using ``add_notfound_view`` or |
|
2543 |
``notfound_view_config``. |
|
2544 |
|
|
2545 |
- Updated the "Creating a Not Forbidden View" section of the "Hooks" chapter, |
|
2546 |
replacing explanations of registering a view using ``add_view`` or |
|
2547 |
``view_config`` with ones using ``add_forbidden_view`` or |
|
2548 |
``forbidden_view_config``. |
|
2549 |
|
|
2550 |
- Updated the "Redirecting to Slash-Appended Routes" section of the "URL |
|
2551 |
Dispatch" chapter, replacing explanations of registering a view using |
|
2552 |
``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or |
|
2553 |
``notfound_view_config`` |
|
2554 |
|
|
2555 |
- Updated all tutorials to use ``pyramid.view.forbidden_view_config`` rather |
|
2556 |
than ``pyramid.view.view_config`` with an HTTPForbidden context. |
|
2557 |
|
|
2558 |
1.3a8 (2012-02-19) |
|
2559 |
================== |
|
2560 |
|
|
2561 |
Features |
|
2562 |
-------- |
|
2563 |
|
|
2564 |
- The ``scan`` method of a ``Configurator`` can be passed an ``ignore`` |
|
2565 |
argument, which can be a string, a callable, or a list consisting of |
|
2566 |
strings and/or callables. This feature allows submodules, subpackages, and |
|
2567 |
global objects from being scanned. See |
|
2568 |
http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for |
|
2569 |
more information about how to use the ``ignore`` argument to ``scan``. |
|
2570 |
|
|
2571 |
- Better error messages when a view callable returns a value that cannot be |
|
2572 |
converted to a response (for example, when a view callable returns a |
|
2573 |
dictionary without a renderer defined, or doesn't return any value at all). |
|
2574 |
The error message now contains information about the view callable itself |
|
2575 |
as well as the result of calling it. |
|
2576 |
|
|
2577 |
- Better error message when a .pyc-only module is ``config.include`` -ed. |
|
2578 |
This is not permitted due to error reporting requirements, and a better |
|
2579 |
error message is shown when it is attempted. Previously it would fail with |
|
2580 |
something like "AttributeError: 'NoneType' object has no attribute |
|
2581 |
'rfind'". |
|
2582 |
|
|
2583 |
- Add ``pyramid.config.Configurator.add_traverser`` API method. See the |
|
2584 |
Hooks narrative documentation section entitled "Changing the Traverser" for |
|
2585 |
more information. This is not a new feature, it just provides an API for |
|
2586 |
adding a traverser without needing to use the ZCA API. |
|
2587 |
|
|
2588 |
- Add ``pyramid.config.Configurator.add_resource_url_adapter`` API method. |
|
2589 |
See the Hooks narrative documentation section entitled "Changing How |
|
2590 |
pyramid.request.Request.resource_url Generates a URL" for more information. |
|
2591 |
This is not a new feature, it just provides an API for adding a resource |
|
2592 |
url adapter without needing to use the ZCA API. |
|
2593 |
|
|
2594 |
- The system value ``req`` is now supplied to renderers as an alias for |
|
2595 |
``request``. This means that you can now, for example, in a template, do |
|
2596 |
``req.route_url(...)`` instead of ``request.route_url(...)``. This is |
|
2597 |
purely a change to reduce the amount of typing required to use request |
|
2598 |
methods and attributes from within templates. The value ``request`` is |
|
2599 |
still available too, this is just an alternative. |
|
2600 |
|
|
2601 |
- A new interface was added: ``pyramid.interfaces.IResourceURL``. An adapter |
|
2602 |
implementing its interface can be used to override resource URL generation |
|
2603 |
when ``request.resource_url`` is called. This interface replaces the |
|
2604 |
now-deprecated ``pyramid.interfaces.IContextURL`` interface. |
|
2605 |
|
|
2606 |
- The dictionary passed to a resource's ``__resource_url__`` method (see |
|
2607 |
"Overriding Resource URL Generation" in the "Resources" chapter) now |
|
2608 |
contains an ``app_url`` key, representing the application URL generated |
|
2609 |
during ``request.resource_url``. It represents a potentially customized |
|
2610 |
URL prefix, containing potentially custom scheme, host and port information |
|
2611 |
passed by the user to ``request.resource_url``. It should be used instead |
|
2612 |
of ``request.application_url`` where necessary. |
|
2613 |
|
|
2614 |
- The ``request.resource_url`` API now accepts these arguments: ``app_url``, |
|
2615 |
``scheme``, ``host``, and ``port``. The app_url argument can be used to |
|
2616 |
replace the URL prefix wholesale during url generation. The ``scheme``, |
|
2617 |
``host``, and ``port`` arguments can be used to replace the respective |
|
2618 |
default values of ``request.application_url`` partially. |
|
2619 |
|
|
2620 |
- A new API named ``request.resource_path`` now exists. It works like |
|
2621 |
``request.resource_url`` but produces a relative URL rather than an |
|
2622 |
absolute one. |
|
2623 |
|
|
2624 |
- The ``request.route_url`` API now accepts these arguments: ``_app_url``, |
|
2625 |
``_scheme``, ``_host``, and ``_port``. The ``_app_url`` argument can be |
|
2626 |
used to replace the URL prefix wholesale during url generation. The |
|
2627 |
``_scheme``, ``_host``, and ``_port`` arguments can be used to replace the |
|
2628 |
respective default values of ``request.application_url`` partially. |
|
2629 |
|
|
2630 |
Backwards Incompatibilities |
|
2631 |
--------------------------- |
|
2632 |
|
|
2633 |
- The ``pyramid.interfaces.IContextURL`` interface has been deprecated. |
|
2634 |
People have been instructed to use this to register a resource url adapter |
|
2635 |
in the "Hooks" chapter to use to influence ``request.resource_url`` URL |
|
2636 |
generation for resources found via custom traversers since Pyramid 1.0. |
|
2637 |
|
|
2638 |
The interface still exists and registering such an adapter still works, but |
|
2639 |
this interface will be removed from the software after a few major Pyramid |
|
2640 |
releases. You should replace it with an equivalent |
|
2641 |
``pyramid.interfaces.IResourceURL`` adapter, registered using the new |
|
2642 |
``pyramid.config.Configurator.add_resource_url_adapter`` API. A |
|
2643 |
deprecation warning is now emitted when a |
|
2644 |
``pyramid.interfaces.IContextURL`` adapter is found when |
|
2645 |
``request.resource_url`` is called. |
|
2646 |
|
|
2647 |
Documentation |
|
2648 |
------------- |
|
2649 |
|
|
2650 |
- Don't create a ``session`` instance in SQLA Wiki tutorial, use raw |
|
2651 |
``DBSession`` instead (this is more common in real SQLA apps). |
|
2652 |
|
|
2653 |
Scaffolding |
|
2654 |
----------- |
|
2655 |
|
|
2656 |
- Put ``pyramid.includes`` targets within ini files in scaffolds on separate |
|
2657 |
lines in order to be able to tell people to comment out only the |
|
2658 |
``pyramid_debugtoolbar`` line when they want to disable the toolbar. |
|
2659 |
|
|
2660 |
Dependencies |
|
2661 |
------------ |
|
2662 |
|
|
2663 |
- Depend on ``venusian`` >= 1.0a3 to provide scan ``ignore`` support. |
|
2664 |
|
|
2665 |
Internal |
|
2666 |
-------- |
|
2667 |
|
|
2668 |
- Create a "MakoRendererFactoryHelper" that provides customizable settings |
|
2669 |
key prefixes. Allows settings prefixes other than "mako." to be used to |
|
2670 |
create different factories that don't use the global mako settings. This |
|
2671 |
will be useful for the debug toolbar, which can currently be sabotaged by |
|
2672 |
someone using custom mako configuration settings. |
|
2673 |
|
|
2674 |
1.3a7 (2012-02-07) |
|
2675 |
================== |
|
2676 |
|
|
2677 |
Features |
|
2678 |
-------- |
|
2679 |
|
|
2680 |
- More informative error message when a ``config.include`` cannot find an |
|
2681 |
``includeme``. See https://github.com/Pylons/pyramid/pull/392. |
|
2682 |
|
|
2683 |
- Internal: catch unhashable discriminators early (raise an error instead of |
|
2684 |
allowing them to find their way into resolveConflicts). |
|
2685 |
|
|
2686 |
- The `match_param` view predicate now accepts a string or a tuple. |
|
2687 |
This replaces the broken behavior of accepting a dict. See |
|
2688 |
https://github.com/Pylons/pyramid/issues/425 for more information. |
|
2689 |
|
|
2690 |
Bug Fixes |
|
2691 |
--------- |
|
2692 |
|
|
2693 |
- The process will now restart when ``pserve`` is used with the ``--reload`` |
|
2694 |
flag when the ``development.ini`` file (or any other .ini file in use) is |
|
2695 |
changed. See https://github.com/Pylons/pyramid/issues/377 and |
|
2696 |
https://github.com/Pylons/pyramid/pull/411 |
|
2697 |
|
|
2698 |
- The ``prequest`` script would fail when used against URLs which did not |
|
2699 |
return HTML or text. See https://github.com/Pylons/pyramid/issues/381 |
|
2700 |
|
|
2701 |
Backwards Incompatibilities |
|
2702 |
--------------------------- |
|
2703 |
|
|
2704 |
- The `match_param` view predicate no longer accepts a dict. This will |
|
2705 |
have no negative affect because the implementation was broken for |
|
2706 |
dict-based arguments. |
|
2707 |
|
|
2708 |
Documentation |
|
2709 |
------------- |
|
2710 |
|
|
2711 |
- Add a traversal hello world example to the narrative docs. |
|
2712 |
|
|
2713 |
1.3a6 (2012-01-20) |
|
2714 |
================== |
|
2715 |
|
|
2716 |
Features |
|
2717 |
-------- |
|
2718 |
|
|
2719 |
- New API: ``pyramid.config.Configurator.set_request_property``. Add lazy |
|
2720 |
property descriptors to a request without changing the request factory. |
|
2721 |
This method provides conflict detection and is the suggested way to add |
|
2722 |
properties to a request. |
|
2723 |
|
|
2724 |
- Responses generated by Pyramid's ``static_view`` now use |
|
2725 |
a ``wsgi.file_wrapper`` (see |
|
2726 |
http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling) |
|
2727 |
when one is provided by the web server. |
|
2728 |
|
|
2729 |
Bug Fixes |
|
2730 |
--------- |
|
2731 |
|
|
2732 |
- Views registered with an ``accept`` could not be overridden correctly with |
|
2733 |
a different view that had the same predicate arguments. See |
|
2734 |
https://github.com/Pylons/pyramid/pull/404 for more information. |
|
2735 |
|
|
2736 |
- When using a dotted name for a ``view`` argument to |
|
2737 |
``Configurator.add_view`` that pointed to a class with a ``view_defaults`` |
|
2738 |
decorator, the view defaults would not be applied. See |
|
2739 |
https://github.com/Pylons/pyramid/issues/396 . |
|
2740 |
|
|
2741 |
- Static URL paths were URL-quoted twice. See |
|
2742 |
https://github.com/Pylons/pyramid/issues/407 . |
|
2743 |
|
|
2744 |
1.3a5 (2012-01-09) |
|
2745 |
================== |
|
2746 |
|
|
2747 |
Bug Fixes |
|
2748 |
--------- |
|
2749 |
|
|
2750 |
- The ``pyramid.view.view_defaults`` decorator did not work properly when |
|
2751 |
more than one view relied on the defaults being different for configuration |
|
2752 |
conflict resolution. See https://github.com/Pylons/pyramid/issues/394. |
|
2753 |
|
|
2754 |
Backwards Incompatibilities |
|
2755 |
--------------------------- |
|
2756 |
|
|
2757 |
- The ``path_info`` route and view predicates now match against |
|
2758 |
``request.upath_info`` (Unicode) rather than ``request.path_info`` |
|
2759 |
(indeterminate value based on Python 3 vs. Python 2). This has to be done |
|
2760 |
to normalize matching on Python 2 and Python 3. |
|
2761 |
|
|
2762 |
1.3a4 (2012-01-05) |
|
2763 |
================== |
|
2764 |
|
|
2765 |
Features |
|
2766 |
-------- |
|
2767 |
|
|
2768 |
- New API: ``pyramid.request.Request.set_property``. Add lazy property |
|
2769 |
descriptors to a request without changing the request factory. New |
|
2770 |
properties may be reified, effectively caching the value for the lifetime |
|
2771 |
of the instance. Common use-cases for this would be to get a database |
|
2772 |
connection for the request or identify the current user. |
|
2773 |
|
|
2774 |
- Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding. |
|
2775 |
|
|
2776 |
Bug Fixes |
|
2777 |
--------- |
|
2778 |
|
|
2779 |
- The documentation of ``pyramid.events.subscriber`` indicated that using it |
|
2780 |
as a decorator with no arguments like this:: |
|
2781 |
|
|
2782 |
@subscriber() |
|
2783 |
def somefunc(event): |
|
2784 |
pass |
|
2785 |
|
|
2786 |
Would register ``somefunc`` to receive all events sent via the registry, |
|
2787 |
but this was untrue. Instead, it would receive no events at all. This has |
|
2788 |
now been fixed and the code matches the documentation. See also |
|
2789 |
https://github.com/Pylons/pyramid/issues/386 |
|
2790 |
|
|
2791 |
- Literal portions of route patterns were not URL-quoted when ``route_url`` |
|
2792 |
or ``route_path`` was used to generate a URL or path. |
|
2793 |
|
|
2794 |
- The result of ``route_path`` or ``route_url`` might have been ``unicode`` |
|
2795 |
or ``str`` depending on the input. It is now guaranteed to always be |
|
2796 |
``str``. |
|
2797 |
|
|
2798 |
- URL matching when the pattern contained non-ASCII characters in literal |
|
2799 |
parts was indeterminate. Now the pattern supplied to ``add_route`` is |
|
2800 |
assumed to be either: a ``unicode`` value, or a ``str`` value that contains |
|
2801 |
only ASCII characters. If you now want to match the path info from a URL |
|
2802 |
that contains high order characters, you can pass the Unicode |
|
2803 |
representation of the decoded path portion in the pattern. |
|
2804 |
|
|
2805 |
- When using a ``traverse=`` route predicate, traversal would fail with a |
|
2806 |
URLDecodeError if there were any high-order characters in the traversal |
|
2807 |
pattern or in the matched dynamic segments. |
|
2808 |
|
|
2809 |
- Using a dynamic segment named ``traverse`` in a route pattern like this:: |
|
2810 |
|
|
2811 |
config.add_route('trav_route', 'traversal/{traverse:.*}') |
|
2812 |
|
|
2813 |
Would cause a ``UnicodeDecodeError`` when the route was matched and the |
|
2814 |
matched portion of the URL contained any high-order characters. See |
|
2815 |
https://github.com/Pylons/pyramid/issues/385 . |
|
2816 |
|
|
2817 |
- When using a ``*traverse`` stararg in a route pattern, a URL that matched |
|
2818 |
that possessed a ``@@`` in its name (signifying a view name) would be |
|
2819 |
inappropriately quoted by the traversal machinery during traversal, |
|
2820 |
resulting in the view not being found properly. See |
|
2821 |
https://github.com/Pylons/pyramid/issues/382 and |
|
2822 |
https://github.com/Pylons/pyramid/issues/375 . |
|
2823 |
|
|
2824 |
Backwards Incompatibilities |
|
2825 |
--------------------------- |
|
2826 |
|
|
2827 |
- String values passed to ``route_url`` or ``route_path`` that are meant to |
|
2828 |
replace "remainder" matches will now be URL-quoted except for embedded |
|
2829 |
slashes. For example:: |
|
2830 |
|
|
2831 |
config.add_route('remain', '/foo*remainder') |
|
2832 |
request.route_path('remain', remainder='abc / def') |
|
2833 |
# -> '/foo/abc%20/%20def' |
|
2834 |
|
|
2835 |
Previously string values passed as remainder replacements were tacked on |
|
2836 |
untouched, without any URL-quoting. But this doesn't really work logically |
|
2837 |
if the value passed is Unicode (raw unicode cannot be placed in a URL or in |
|
2838 |
a path) and it is inconsistent with the rest of the URL generation |
|
2839 |
machinery if the value is a string (it won't be quoted unless by the |
|
2840 |
caller). |
|
2841 |
|
|
2842 |
Some folks will have been relying on the older behavior to tack on query |
|
2843 |
string elements and anchor portions of the URL; sorry, you'll need to |
|
2844 |
change your code to use the ``_query`` and/or ``_anchor`` arguments to |
|
2845 |
``route_path`` or ``route_url`` to do this now. |
|
2846 |
|
|
2847 |
- If you pass a bytestring that contains non-ASCII characters to |
|
2848 |
``add_route`` as a pattern, it will now fail at startup time. Use Unicode |
|
2849 |
instead. |
|
2850 |
|
|
2851 |
1.3a3 (2011-12-21) |
|
2852 |
================== |
|
2853 |
|
|
2854 |
Features |
|
2855 |
-------- |
|
2856 |
|
|
2857 |
- Added a ``prequest`` script (along the lines of ``paster request``). It is |
|
2858 |
documented in the "Command-Line Pyramid" chapter in the section entitled |
|
2859 |
"Invoking a Request". |
|
2860 |
|
|
2861 |
- Add undocumented ``__discriminator__`` API to derived view callables. |
|
2862 |
e.g. ``adapters.lookup(...).__discriminator__(context, request)``. It will |
|
2863 |
be used by superdynamic systems that require the discriminator to be used |
|
2864 |
for introspection after manual view lookup. |
|
2865 |
|
|
2866 |
Bug Fixes |
|
2867 |
--------- |
|
2868 |
|
|
2869 |
- Normalized exit values and ``-h`` output for all ``p*`` scripts |
|
2870 |
(``pviews``, ``proutes``, etc). |
|
2871 |
|
|
2872 |
Documentation |
|
2873 |
------------- |
|
2874 |
|
|
2875 |
- Added a section named "Making Your Script into a Console Script" in the |
|
2876 |
"Command-Line Pyramid" chapter. |
|
2877 |
|
|
2878 |
- Removed the "Running Pyramid on Google App Engine" tutorial from the main |
|
2879 |
docs. It survives on in the Cookbook |
cd8ac8
|
2880 |
(http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/gae.html). |
2c949d
|
2881 |
Rationale: it provides the correct info for the Python 2.5 version of GAE |
CM |
2882 |
only, and this version of Pyramid does not support Python 2.5. |
|
2883 |
|
|
2884 |
1.3a2 (2011-12-14) |
|
2885 |
================== |
|
2886 |
|
|
2887 |
Features |
|
2888 |
-------- |
|
2889 |
|
|
2890 |
- New API: ``pyramid.view.view_defaults``. If you use a class as a view, you |
|
2891 |
can use the new ``view_defaults`` class decorator on the class to provide |
|
2892 |
defaults to the view configuration information used by every |
|
2893 |
``@view_config`` decorator that decorates a method of that class. It also |
|
2894 |
works against view configurations involving a class made imperatively. |
|
2895 |
|
|
2896 |
- Added a backwards compatibility knob to ``pcreate`` to emulate ``paster |
|
2897 |
create`` handling for the ``--list-templates`` option. |
|
2898 |
|
|
2899 |
- Changed scaffolding machinery around a bit to make it easier for people who |
|
2900 |
want to have extension scaffolds that can work across Pyramid 1.0.X, 1.1.X, |
|
2901 |
1.2.X and 1.3.X. See the new "Creating Pyramid Scaffolds" chapter in the |
|
2902 |
narrative documentation for more info. |
|
2903 |
|
|
2904 |
Documentation |
|
2905 |
------------- |
|
2906 |
|
|
2907 |
- Added documentation to "View Configuration" narrative documentation chapter |
|
2908 |
about ``view_defaults`` class decorator. |
|
2909 |
|
|
2910 |
- Added API docs for ``view_defaults`` class decorator. |
|
2911 |
|
|
2912 |
- Added an API docs chapter for ``pyramid.scaffolds``. |
|
2913 |
|
|
2914 |
- Added a narrative docs chapter named "Creating Pyramid Scaffolds". |
|
2915 |
|
|
2916 |
Backwards Incompatibilities |
|
2917 |
--------------------------- |
|
2918 |
|
|
2919 |
- The ``template_renderer`` method of ``pyramid.scaffolds.PyramidScaffold`` |
|
2920 |
was renamed to ``render_template``. If you were overriding it, you're a |
|
2921 |
bad person, because it wasn't an API before now. But we're nice so we're |
|
2922 |
letting you know. |
|
2923 |
|
|
2924 |
1.3a1 (2011-12-09) |
|
2925 |
================== |
|
2926 |
|
|
2927 |
Features |
|
2928 |
-------- |
|
2929 |
|
|
2930 |
- Python 3.2 compatibility. |
|
2931 |
|
|
2932 |
- New ``pyramid.compat`` module and API documentation which provides Python |
|
2933 |
2/3 straddling support for Pyramid add-ons and development environments. |
|
2934 |
|
|
2935 |
- A ``mako.directories`` setting is no longer required to use Mako templates |
|
2936 |
Rationale: Mako template renderers can be specified using an absolute asset |
|
2937 |
spec. An entire application can be written with such asset specs, |
|
2938 |
requiring no ordered lookup path. |
|
2939 |
|
|
2940 |
- ``bpython`` interpreter compatibility in ``pshell``. See the "Command-Line |
|
2941 |
Pyramid" narrative docs chapter for more information. |
|
2942 |
|
|
2943 |
- Added ``get_appsettings`` API function to the ``pyramid.paster`` module. |
|
2944 |
This function returns the settings defined within an ``[app:...]`` section |
|
2945 |
in a PasteDeploy ini file. |
|
2946 |
|
|
2947 |
- Added ``setup_logging`` API function to the ``pyramid.paster`` module. |
|
2948 |
This function sets up Python logging according to the logging configuration |
|
2949 |
in a PasteDeploy ini file. |
|
2950 |
|
|
2951 |
- Configuration conflict reporting is reported in a more understandable way |
|
2952 |
("Line 11 in file..." vs. a repr of a tuple of similar info). |
|
2953 |
|
|
2954 |
- A configuration introspection system was added; see the narrative |
|
2955 |
documentation chapter entitled "Pyramid Configuration Introspection" for |
|
2956 |
more information. New APIs: ``pyramid.registry.Introspectable``, |
|
2957 |
``pyramid.config.Configurator.introspector``, |
|
2958 |
``pyramid.config.Configurator.introspectable``, |
|
2959 |
``pyramid.registry.Registry.introspector``. |
|
2960 |
|
|
2961 |
- Allow extra keyword arguments to be passed to the |
|
2962 |
``pyramid.config.Configurator.action`` method. |
|
2963 |
|
|
2964 |
- New APIs: ``pyramid.path.AssetResolver`` and |
|
2965 |
``pyramid.path.DottedNameResolver``. The former can be used to resolve |
|
2966 |
asset specifications, the latter can be used to resolve dotted names to |
|
2967 |
modules or packages. |
|
2968 |
|
|
2969 |
Bug Fixes |
|
2970 |
--------- |
|
2971 |
|
|
2972 |
- Make test suite pass on 32-bit systems; closes #286. closes #306. |
|
2973 |
See also https://github.com/Pylons/pyramid/issues/286 |
|
2974 |
|
ef2a4a
|
2975 |
- The ``pyramid.view.view_config`` decorator did not accept a ``match_params`` |
2c949d
|
2976 |
predicate argument. See https://github.com/Pylons/pyramid/pull/308 |
CM |
2977 |
|
|
2978 |
- The AuthTktCookieHelper could potentially generate Unicode headers |
|
2979 |
inappropriately when the ``tokens`` argument to remember was used. See |
|
2980 |
https://github.com/Pylons/pyramid/pull/314. |
|
2981 |
|
|
2982 |
- The AuthTktAuthenticationPolicy did not use a timing-attack-aware string |
|
2983 |
comparator. See https://github.com/Pylons/pyramid/pull/320 for more info. |
|
2984 |
|
|
2985 |
- The DummySession in ``pyramid.testing`` now generates a new CSRF token if |
|
2986 |
one doesn't yet exist. |
|
2987 |
|
|
2988 |
- ``request.static_url`` now generates URL-quoted URLs when fed a ``path`` |
|
2989 |
argument which contains characters that are unsuitable for URLs. See |
|
2990 |
https://github.com/Pylons/pyramid/issues/349 for more info. |
|
2991 |
|
|
2992 |
- Prevent a scaffold rendering from being named ``site`` (conflicts with |
|
2993 |
Python internal site.py). |
|
2994 |
|
|
2995 |
- Support for using instances as targets of the ``pyramid.wsgi.wsgiapp`` and |
|
2996 |
``pryramid.wsgi.wsgiapp2`` functions. |
|
2997 |
See https://github.com/Pylons/pyramid/pull/370 for more info. |
|
2998 |
|
|
2999 |
Backwards Incompatibilities |
|
3000 |
--------------------------- |
|
3001 |
|
|
3002 |
- Pyramid no longer runs on Python 2.5 (which includes the most recent |
|
3003 |
release of Jython and the Python 2.5 version of GAE as of this writing). |
|
3004 |
|
|
3005 |
- The ``paster`` command is no longer the documented way to create projects, |
|
3006 |
start the server, or run debugging commands. To create projects from |
|
3007 |
scaffolds, ``paster create`` is replaced by the ``pcreate`` console script. |
|
3008 |
To serve up a project, ``paster serve`` is replaced by the ``pserve`` |
|
3009 |
console script. New console scripts named ``pshell``, ``pviews``, |
|
3010 |
``proutes``, and ``ptweens`` do what their ``paster <commandname>`` |
|
3011 |
equivalents used to do. Rationale: the Paste and PasteScript packages do |
|
3012 |
not run under Python 3. |
|
3013 |
|
|
3014 |
- The default WSGI server run as the result of ``pserve`` from newly rendered |
|
3015 |
scaffolding is now the ``wsgiref`` WSGI server instead of the |
|
3016 |
``paste.httpserver`` server. Rationale: Rationale: the Paste and |
|
3017 |
PasteScript packages do not run under Python 3. |
|
3018 |
|
|
3019 |
- The ``pshell`` command (see "paster pshell") no longer accepts a |
|
3020 |
``--disable-ipython`` command-line argument. Instead, it accepts a ``-p`` |
|
3021 |
or ``--python-shell`` argument, which can be any of the values ``python``, |
|
3022 |
``ipython`` or ``bpython``. |
|
3023 |
|
|
3024 |
- Removed the ``pyramid.renderers.renderer_from_name`` function. It has been |
|
3025 |
deprecated since Pyramid 1.0, and was never an API. |
|
3026 |
|
|
3027 |
- To use ZCML with versions of Pyramid >= 1.3, you will need ``pyramid_zcml`` |
|
3028 |
version >= 0.8 and ``zope.configuration`` version >= 3.8.0. The |
|
3029 |
``pyramid_zcml`` package version 0.8 is backwards compatible all the way to |
|
3030 |
Pyramid 1.0, so you won't be warned if you have older versions installed |
|
3031 |
and upgrade Pyramid "in-place"; it may simply break instead. |
|
3032 |
|
|
3033 |
Dependencies |
|
3034 |
------------ |
|
3035 |
|
|
3036 |
- Pyramid no longer depends on the ``zope.component`` package, except as a |
|
3037 |
testing dependency. |
|
3038 |
|
|
3039 |
- Pyramid now depends on a zope.interface>=3.8.0, WebOb>=1.2dev, |
|
3040 |
repoze.lru>=0.4, zope.deprecation>=3.5.0, translationstring>=0.4 (for |
|
3041 |
Python 3 compatibility purposes). It also, as a testing dependency, |
|
3042 |
depends on WebTest>=1.3.1 for the same reason. |
|
3043 |
|
|
3044 |
- Pyramid no longer depends on the Paste or PasteScript packages. |
|
3045 |
|
|
3046 |
Documentation |
|
3047 |
------------- |
|
3048 |
|
|
3049 |
- The SQLAlchemy Wiki tutorial has been updated. It now uses |
|
3050 |
``@view_config`` decorators and an explicit database population script. |
|
3051 |
|
|
3052 |
- Minor updates to the ZODB Wiki tutorial. |
|
3053 |
|
|
3054 |
- A narrative documentation chapter named "Extending Pyramid Configuration" |
|
3055 |
was added; it describes how to add a new directive, and how use the |
|
3056 |
``pyramid.config.Configurator.action`` method within custom directives. It |
|
3057 |
also describes how to add introspectable objects. |
|
3058 |
|
|
3059 |
- A narrative documentation chapter named "Pyramid Configuration |
|
3060 |
Introspection" was added. It describes how to query the introspection |
|
3061 |
system. |
|
3062 |
|
|
3063 |
Scaffolds |
|
3064 |
--------- |
|
3065 |
|
|
3066 |
- Rendered scaffolds have now been changed to be more relocatable (fewer |
|
3067 |
mentions of the package name within files in the package). |
|
3068 |
|
|
3069 |
- The ``routesalchemy`` scaffold has been renamed ``alchemy``, replacing the |
|
3070 |
older (traversal-based) ``alchemy`` scaffold (which has been retired). |
|
3071 |
|
|
3072 |
- The ``starter`` scaffold now uses URL dispatch by default. |
|
3073 |
|
e04cbb
|
3074 |
1.2 (2011-09-12) |
CM |
3075 |
================ |
|
3076 |
|
|
3077 |
Features |
|
3078 |
-------- |
|
3079 |
|
|
3080 |
- Route pattern replacement marker names can now begin with an underscore. |
|
3081 |
See https://github.com/Pylons/pyramid/issues/276. |
|
3082 |
|
|
3083 |
1.2b3 (2011-09-11) |
|
3084 |
================== |
|
3085 |
|
|
3086 |
Bug Fixes |
|
3087 |
--------- |
|
3088 |
|
|
3089 |
- The route prefix was not taken into account when a static view was added in |
|
3090 |
an "include". See https://github.com/Pylons/pyramid/issues/266 . |
|
3091 |
|
|
3092 |
1.2b2 (2011-09-08) |
|
3093 |
================== |
|
3094 |
|
|
3095 |
Bug Fixes |
|
3096 |
--------- |
|
3097 |
|
|
3098 |
- The 1.2b1 tarball was a brownbag (particularly for Windows users) because |
|
3099 |
it contained filenames with stray quotation marks in inappropriate places. |
|
3100 |
We depend on ``setuptools-git`` to produce release tarballs, and when it |
|
3101 |
was run to produce the 1.2b1 tarball, it didn't yet cope well with files |
|
3102 |
present in git repositories with high-order characters in their filenames. |
|
3103 |
|
|
3104 |
Documentation |
|
3105 |
------------- |
|
3106 |
|
|
3107 |
- Minor tweaks to the "Introduction" narrative chapter example app and |
|
3108 |
wording. |
|
3109 |
|
|
3110 |
1.2b1 (2011-09-08) |
|
3111 |
================== |
|
3112 |
|
|
3113 |
Bug Fixes |
|
3114 |
--------- |
|
3115 |
|
|
3116 |
- Sometimes falling back from territory translations (``de_DE``) to language |
|
3117 |
translations (``de``) would not work properly when using a localizer. See |
|
3118 |
https://github.com/Pylons/pyramid/issues/263 |
|
3119 |
|
|
3120 |
- The static file serving machinery could not serve files that started with a |
|
3121 |
``.`` (dot) character. |
|
3122 |
|
|
3123 |
- Static files with high-order (super-ASCII) characters in their names could |
|
3124 |
not be served by a static view. The static file serving machinery |
|
3125 |
inappropriately URL-quoted path segments in filenames when asking for files |
|
3126 |
from the filesystem. |
|
3127 |
|
|
3128 |
- Within ``pyramid.traversal.traversal_path`` , canonicalize URL segments |
|
3129 |
from UTF-8 to Unicode before checking whether a segment matches literally |
|
3130 |
one of ``.``, the empty string, or ``..`` in case there's some sneaky way |
|
3131 |
someone might tunnel those strings via UTF-8 that don't match the literals |
|
3132 |
before decoded. |
|
3133 |
|
|
3134 |
Documentation |
|
3135 |
------------- |
|
3136 |
|
|
3137 |
- Added a "What Makes Pyramid Unique" section to the Introduction narrative |
|
3138 |
chapter. |
|
3139 |
|
|
3140 |
1.2a6 (2011-09-06) |
|
3141 |
================== |
|
3142 |
|
|
3143 |
Bug Fixes |
|
3144 |
--------- |
|
3145 |
|
|
3146 |
- AuthTktAuthenticationPolicy with a ``reissue_time`` interfered with logout. |
|
3147 |
See https://github.com/Pylons/pyramid/issues/262. |
|
3148 |
|
|
3149 |
Internal |
|
3150 |
-------- |
|
3151 |
|
|
3152 |
- Internalize code previously depended upon as imports from the |
|
3153 |
``paste.auth`` module (futureproof). |
|
3154 |
|
|
3155 |
- Replaced use of ``paste.urlparser.StaticURLParser`` with a derivative of |
|
3156 |
Chris Rossi's "happy" static file serving code (futureproof). |
|
3157 |
|
|
3158 |
- Fixed test suite; on some systems tests would fail due to indeterminate |
|
3159 |
test run ordering and a double-push-single-pop of a shared test variable. |
|
3160 |
|
|
3161 |
Behavior Differences |
|
3162 |
-------------------- |
|
3163 |
|
|
3164 |
- An ETag header is no longer set when serving a static file. A |
|
3165 |
Last-Modified header is set instead. |
|
3166 |
|
|
3167 |
- Static file serving no longer supports the ``wsgi.file_wrapper`` extension. |
|
3168 |
|
|
3169 |
- Instead of returning a ``403 Forbidden`` error when a static file is served |
|
3170 |
that cannot be accessed by the Pyramid process' user due to file |
|
3171 |
permissions, an IOError (or similar) will be raised. |
|
3172 |
|
|
3173 |
Scaffolds |
|
3174 |
--------- |
|
3175 |
|
|
3176 |
- All scaffolds now send the ``cache_max_age`` parameter to the |
|
3177 |
``add_static_view`` method. |
|
3178 |
|
|
3179 |
1.2a5 (2011-09-04) |
|
3180 |
================== |
|
3181 |
|
|
3182 |
Bug Fixes |
|
3183 |
--------- |
|
3184 |
|
|
3185 |
- The ``route_prefix`` of a configurator was not properly taken into account |
|
3186 |
when registering routes in certain circumstances. See |
|
3187 |
https://github.com/Pylons/pyramid/issues/260 |
|
3188 |
|
|
3189 |
Dependencies |
|
3190 |
------------ |
|
3191 |
|
|
3192 |
- The ``zope.configuration`` package is no longer a dependency. |
|
3193 |
|
|
3194 |
1.2a4 (2011-09-02) |
|
3195 |
================== |
|
3196 |
|
|
3197 |
Features |
|
3198 |
-------- |
|
3199 |
|
|
3200 |
- Support an ``onerror`` keyword argument to |
|
3201 |
``pyramid.config.Configurator.scan()``. This onerror keyword argument is |
|
3202 |
passed to ``venusian.Scanner.scan()`` to influence error behavior when |
|
3203 |
an exception is raised during scanning. |
|
3204 |
|
|
3205 |
- The ``request_method`` predicate argument to |
|
3206 |
``pyramid.config.Configurator.add_view`` and |
|
3207 |
``pyramid.config.Configurator.add_route`` is now permitted to be a tuple of |
|
3208 |
HTTP method names. Previously it was restricted to being a string |
|
3209 |
representing a single HTTP method name. |
|
3210 |
|
|
3211 |
- Undeprecated ``pyramid.traversal.find_model``, |
|
3212 |
``pyramid.traversal.model_path``, ``pyramid.traversal.model_path_tuple``, |
|
3213 |
and ``pyramid.url.model_url``, which were all deprecated in Pyramid 1.0. |
|
3214 |
There's just not much cost to keeping them around forever as aliases to |
|
3215 |
their renamed ``resource_*`` prefixed functions. |
|
3216 |
|
|
3217 |
- Undeprecated ``pyramid.view.bfg_view``, which was deprecated in Pyramid |
|
3218 |
1.0. This is a low-cost alias to ``pyramid.view.view_config`` which we'll |
|
3219 |
just keep around forever. |
|
3220 |
|
|
3221 |
Dependencies |
|
3222 |
------------ |
|
3223 |
|
|
3224 |
- Pyramid now requires Venusian 1.0a1 or better to support the ``onerror`` |
|
3225 |
keyword argument to ``pyramid.config.Configurator.scan``. |
|
3226 |
|
|
3227 |
1.2a3 (2011-08-29) |
|
3228 |
================== |
|
3229 |
|
|
3230 |
Bug Fixes |
|
3231 |
--------- |
|
3232 |
|
|
3233 |
- Pyramid did not properly generate static URLs using |
|
3234 |
``pyramid.url.static_url`` when passed a caller-package relative path due |
|
3235 |
to a refactoring done in 1.2a1. |
|
3236 |
|
|
3237 |
- The ``settings`` object emitted a deprecation warning any time |
|
3238 |
``__getattr__`` was called upon it. However, there are legitimate |
|
3239 |
situations in which ``__getattr__`` is called on arbitrary objects |
|
3240 |
(e.g. ``hasattr``). Now, the ``settings`` object only emits the warning |
|
3241 |
upon successful lookup. |
|
3242 |
|
|
3243 |
Internal |
|
3244 |
-------- |
|
3245 |
|
|
3246 |
- Use ``config.with_package`` in view_config decorator rather than |
|
3247 |
manufacturing a new renderer helper (cleanup). |
|
3248 |
|
|
3249 |
1.2a2 (2011-08-27) |
|
3250 |
================== |
|
3251 |
|
|
3252 |
Bug Fixes |
|
3253 |
--------- |
|
3254 |
|
|
3255 |
- When a ``renderers=`` argument is not specified to the Configurator |
|
3256 |
constructor, eagerly register and commit the default renderer set. This |
|
3257 |
permits the overriding of the default renderers, which was broken in 1.2a1 |
|
3258 |
without a commit directly after Configurator construction. |
|
3259 |
|
|
3260 |
- Mako rendering exceptions had the wrong value for an error message. |
|
3261 |
|
|
3262 |
- An include could not set a root factory successfully because the |
|
3263 |
Configurator constructor unconditionally registered one that would be |
|
3264 |
treated as if it were "the word of the user". |
|
3265 |
|
|
3266 |
Features |
|
3267 |
-------- |
|
3268 |
|
|
3269 |
- A session factory can now be passed in using the dotted name syntax. |
|
3270 |
|
|
3271 |
1.2a1 (2011-08-24) |
|
3272 |
================== |
|
3273 |
|
|
3274 |
Features |
|
3275 |
-------- |
|
3276 |
|
|
3277 |
- The ``[pshell]`` section in an ini configuration file now treats a |
|
3278 |
``setup`` key as a dotted name that points to a callable that is passed the |
|
3279 |
bootstrap environment. It can mutate the environment as necessary for |
|
3280 |
great justice. |
|
3281 |
|
|
3282 |
- A new configuration setting named ``pyramid.includes`` is now available. |
|
3283 |
It is described in the "Environment Variables and ``.ini`` Files Settings" |
|
3284 |
narrative documentation chapter. |
|
3285 |
|
|
3286 |
- Added a ``route_prefix`` argument to the |
|
3287 |
``pyramid.config.Configurator.include`` method. This argument allows you |
|
3288 |
to compose URL dispatch applications together. See the section entitled |
|
3289 |
"Using a Route Prefix to Compose Applications" in the "URL Dispatch" |
|
3290 |
narrative documentation chapter. |
|
3291 |
|
|
3292 |
- Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in |
|
3293 |
``permission=`` statements to view configuration. This constant has a |
|
3294 |
value of the string ``__no_permission_required__``. This string value was |
|
3295 |
previously referred to in documentation; now the documentation uses the |
|
3296 |
constant. |
|
3297 |
|
|
3298 |
- Added a decorator-based way to configure a response adapter: |
|
3299 |
``pyramid.response.response_adapter``. This decorator has the same use as |
|
3300 |
``pyramid.config.Configurator.add_response_adapter`` but it's declarative. |
|
3301 |
|
|
3302 |
- The ``pyramid.events.BeforeRender`` event now has an attribute named |
|
3303 |
``rendering_val``. This can be used to introspect the value returned by a |
|
3304 |
view in a BeforeRender subscriber. |
|
3305 |
|
|
3306 |
- New configurator directive: ``pyramid.config.Configurator.add_tween``. |
|
3307 |
This directive adds a "tween". A "tween" is used to wrap the Pyramid |
|
3308 |
router's primary request handling function. This is a feature may be used |
|
3309 |
by Pyramid framework extensions, to provide, for example, view timing |
|
3310 |
support and as a convenient place to hang bookkeeping code. |
|
3311 |
|
|
3312 |
Tweens are further described in the narrative docs section in the Hooks |
|
3313 |
chapter, named "Registering Tweens". |
|
3314 |
|
|
3315 |
- New paster command ``paster ptweens``, which prints the current "tween" |
|
3316 |
configuration for an application. See the section entitled "Displaying |
|
3317 |
Tweens" in the Command-Line Pyramid chapter of the narrative documentation |
|
3318 |
for more info. |
|
3319 |
|
|
3320 |
- The Pyramid debug logger now uses the standard logging configuration |
|
3321 |
(usually set up by Paste as part of startup). This means that output from |
|
3322 |
e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the |
|
3323 |
normal logging channels. The logger name of the debug logger will be the |
|
3324 |
package name of the *caller* of the Configurator's constructor. |
|
3325 |
|
|
3326 |
- A new attribute is available on request objects: ``exc_info``. Its value |
|
3327 |
will be ``None`` until an exception is caught by the Pyramid router, after |
|
3328 |
which it will be the result of ``sys.exc_info()``. |
|
3329 |
|
|
3330 |
- ``pyramid.testing.DummyRequest`` now implements the |
|
3331 |
``add_finished_callback`` and ``add_response_callback`` methods. |
|
3332 |
|
|
3333 |
- New methods of the ``pyramid.config.Configurator`` class: |
|
3334 |
``set_authentication_policy`` and ``set_authorization_policy``. These are |
|
3335 |
meant to be consumed mostly by add-on authors. |
|
3336 |
|
|
3337 |
- New Configurator method: ``set_root_factory``. |
|
3338 |
|
|
3339 |
- Pyramid no longer eagerly commits some default configuration statements at |
|
3340 |
Configurator construction time, which permits values passed in as |
|
3341 |
constructor arguments (e.g. ``authentication_policy`` and |
|
3342 |
``authorization_policy``) to override the same settings obtained via an |
|
3343 |
"include". |
|
3344 |
|
|
3345 |
- Better Mako rendering exceptions via |
|
3346 |
``pyramid.mako_templating.MakoRenderingException`` |
|
3347 |
|
|
3348 |
- New request methods: ``current_route_url``, ``current_route_path``, and |
|
3349 |
``static_path``. |
|
3350 |
|
|
3351 |
- New functions in ``pyramid.url``: ``current_route_path`` and |
|
3352 |
``static_path``. |
|
3353 |
|
|
3354 |
- The ``pyramid.request.Request.static_url`` API (and its brethren |
|
3355 |
``pyramid.request.Request.static_path``, ``pyramid.url.static_url``, and |
|
3356 |
``pyramid.url.static_path``) now accept an asbolute filename as a "path" |
|
3357 |
argument. This will generate a URL to an asset as long as the filename is |
|
3358 |
in a directory which was previously registered as a static view. |
|
3359 |
Previously, trying to generate a URL to an asset using an absolute file |
|
3360 |
path would raise a ValueError. |
|
3361 |
|
|
3362 |
- The ``RemoteUserAuthenticationPolicy ``, ``AuthTktAuthenticationPolicy``, |
|
3363 |
and ``SessionAuthenticationPolicy`` constructors now accept an additional |
|
3364 |
keyword argument named ``debug``. By default, this keyword argument is |
|
3365 |
``False``. When it is ``True``, debug information will be sent to the |
|
3366 |
Pyramid debug logger (usually on stderr) when the ``authenticated_userid`` |
|
3367 |
or ``effective_principals`` method is called on any of these policies. The |
|
3368 |
output produced can be useful when trying to diagnose |
|
3369 |
authentication-related problems. |
|
3370 |
|
|
3371 |
- New view predicate: ``match_param``. Example: a view added via |
|
3372 |
``config.add_view(aview, match_param='action=edit')`` will be called only |
|
3373 |
when the ``request.matchdict`` has a value inside it named ``action`` with |
|
3374 |
a value of ``edit``. |
|
3375 |
|
|
3376 |
Internal |
|
3377 |
-------- |
|
3378 |
|
|
3379 |
- The Pyramid "exception view" machinery is now implemented as a "tween" |
|
3380 |
(``pyramid.tweens.excview_tween_factory``). |
|
3381 |
|
|
3382 |
- WSGIHTTPException (HTTPFound, HTTPNotFound, etc) now has a new API named |
|
3383 |
"prepare" which renders the body and content type when it is provided with |
|
3384 |
a WSGI environ. Required for debug toolbar. |
|
3385 |
|
|
3386 |
- Once ``__call__`` or ``prepare`` is called on a WSGIHTTPException, the body |
|
3387 |
will be set, and subsequent calls to ``__call__`` will always return the |
|
3388 |
same body. Delete the body attribute to rerender the exception body. |
|
3389 |
|
|
3390 |
- Previously the ``pyramid.events.BeforeRender`` event *wrapped* a dictionary |
|
3391 |
(it addressed it as its ``_system`` attribute). Now it *is* a dictionary |
|
3392 |
(it inherits from ``dict``), and it's the value that is passed to templates |
|
3393 |
as a top-level dictionary. |
|
3394 |
|
|
3395 |
- The ``route_url``, ``route_path``, ``resource_url``, ``static_url``, and |
|
3396 |
``current_route_url`` functions in the ``pyramid.url`` package now delegate |
|
3397 |
to a method on the request they've been passed, instead of the other way |
|
3398 |
around. The pyramid.request.Request object now inherits from a mixin named |
|
3399 |
pyramid.url.URLMethodsMixin to make this possible, and all url/path |
|
3400 |
generation logic is embedded in this mixin. |
|
3401 |
|
|
3402 |
- Refactor ``pyramid.config`` into a package. |
|
3403 |
|
|
3404 |
- Removed the ``_set_security_policies`` method of the Configurator. |
|
3405 |
|
|
3406 |
- Moved the ``StaticURLInfo`` class from ``pyramid.static`` to |
|
3407 |
``pyramid.config.views``. |
|
3408 |
|
|
3409 |
- Move the ``Settings`` class from ``pyramid.settings`` to |
|
3410 |
``pyramid.config.settings``. |
|
3411 |
|
|
3412 |
- Move the ``OverrideProvider``, ``PackageOverrides``, ``DirectoryOverride``, |
|
3413 |
and ``FileOverride`` classes from ``pyramid.asset`` to |
|
3414 |
``pyramid.config.assets``. |
|
3415 |
|
|
3416 |
Deprecations |
|
3417 |
------------ |
|
3418 |
|
|
3419 |
- All Pyramid-related deployment settings (e.g. ``debug_all``, |
|
3420 |
``debug_notfound``) are now meant to be prefixed with the prefix |
|
3421 |
``pyramid.``. For example: ``debug_all`` -> ``pyramid.debug_all``. The |
|
3422 |
old non-prefixed settings will continue to work indefinitely but supplying |
|
3423 |
them may eventually print a deprecation warning. All scaffolds and |
|
3424 |
tutorials have been changed to use prefixed settings. |
|
3425 |
|
|
3426 |
- The ``settings`` dictionary now raises a deprecation warning when you |
|
3427 |
attempt to access its values via ``__getattr__`` instead of |
|
3428 |
via ``__getitem__``. |
|
3429 |
|
|
3430 |
Backwards Incompatibilities |
|
3431 |
--------------------------- |
|
3432 |
|
|
3433 |
- If a string is passed as the ``debug_logger`` parameter to a Configurator, |
|
3434 |
that string is considered to be the name of a global Python logger rather |
|
3435 |
than a dotted name to an instance of a logger. |
|
3436 |
|
|
3437 |
- The ``pyramid.config.Configurator.include`` method now accepts only a |
|
3438 |
single ``callable`` argument (a sequence of callables used to be |
|
3439 |
permitted). If you are passing more than one ``callable`` to |
|
3440 |
``pyramid.config.Configurator.include``, it will break. You now must now |
|
3441 |
instead make a separate call to the method for each callable. This change |
|
3442 |
was introduced to support the ``route_prefix`` feature of include. |
|
3443 |
|
|
3444 |
- It may be necessary to more strictly order configuration route and view |
|
3445 |
statements when using an "autocommitting" Configurator. In the past, it |
|
3446 |
was possible to add a view which named a route name before adding a route |
|
3447 |
with that name when you used an autocommitting configurator. For example:: |
|
3448 |
|
|
3449 |
config = Configurator(autocommit=True) |
|
3450 |
config.add_view('my.pkg.someview', route_name='foo') |
|
3451 |
config.add_route('foo', '/foo') |
|
3452 |
|
|
3453 |
The above will raise an exception when the view attempts to add itself. |
|
3454 |
Now you must add the route before adding the view:: |
|
3455 |
|
|
3456 |
config = Configurator(autocommit=True) |
|
3457 |
config.add_route('foo', '/foo') |
|
3458 |
config.add_view('my.pkg.someview', route_name='foo') |
|
3459 |
|
|
3460 |
This won't effect "normal" users, only people who have legacy BFG codebases |
|
3461 |
that used an autommitting configurator and possibly tests that use the |
|
3462 |
configurator API (the configurator returned by ``pyramid.testing.setUp`` is |
|
3463 |
an autocommitting configurator). The right way to get around this is to |
|
3464 |
use a non-autocommitting configurator (the default), which does not have |
|
3465 |
these directive ordering requirements. |
|
3466 |
|
|
3467 |
- The ``pyramid.config.Configurator.add_route`` directive no longer returns a |
|
3468 |
route object. This change was required to make route vs. view |
|
3469 |
configuration processing work properly. |
|
3470 |
|
|
3471 |
Documentation |
|
3472 |
------------- |
|
3473 |
|
|
3474 |
- Narrative and API documentation which used the ``route_url``, |
|
3475 |
``route_path``, ``resource_url``, ``static_url``, and ``current_route_url`` |
|
3476 |
functions in the ``pyramid.url`` package have now been changed to use |
|
3477 |
eponymous methods of the request instead. |
|
3478 |
|
|
3479 |
- Added a section entitled "Using a Route Prefix to Compose Applications" to |
|
3480 |
the "URL Dispatch" narrative documentation chapter. |
|
3481 |
|
|
3482 |
- Added a new module to the API docs: ``pyramid.tweens``. |
|
3483 |
|
|
3484 |
- Added a "Registering Tweens" section to the "Hooks" narrative chapter. |
|
3485 |
|
|
3486 |
- Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative |
|
3487 |
chapter. |
|
3488 |
|
|
3489 |
- Added documentation for the ``pyramid.tweens`` and ``pyramid.includes`` |
|
3490 |
configuration settings to the "Environment Variables and ``.ini`` Files |
|
3491 |
Settings" chapter. |
|
3492 |
|
|
3493 |
- Added a Logging chapter to the narrative docs (based on the Pylons logging |
|
3494 |
docs, thanks Phil). |
|
3495 |
|
|
3496 |
- Added a Paste chapter to the narrative docs (moved content from the Project |
|
3497 |
chapter). |
|
3498 |
|
|
3499 |
- Added the ``pyramid.interfaces.IDict`` interface representing the methods |
|
3500 |
of a dictionary, for documentation purposes only (IMultiDict and |
|
3501 |
IBeforeRender inherit from it). |
|
3502 |
|
|
3503 |
- All tutorials now use - The ``route_url``, ``route_path``, |
|
3504 |
``resource_url``, ``static_url``, and ``current_route_url`` methods of the |
|
3505 |
request rather than the function variants imported from ``pyramid.url``. |
|
3506 |
|
|
3507 |
- The ZODB wiki tutorial now uses the ``pyramid_zodbconn`` package rather |
|
3508 |
than the ``repoze.zodbconn`` package to provide ZODB integration. |
|
3509 |
|
|
3510 |
Dependency Changes |
|
3511 |
------------------ |
|
3512 |
|
|
3513 |
- Pyramid now relies on PasteScript >= 1.7.4. This version contains a |
|
3514 |
feature important for allowing flexible logging configuration. |
|
3515 |
|
|
3516 |
Scaffolds |
|
3517 |
---------- |
|
3518 |
|
|
3519 |
- All scaffolds now use the ``pyramid_tm`` package rather than the |
|
3520 |
``repoze.tm2`` middleware to manage transaction management. |
|
3521 |
|
|
3522 |
- The ZODB scaffold now uses the ``pyramid_zodbconn`` package rather than the |
|
3523 |
``repoze.zodbconn`` package to provide ZODB integration. |
|
3524 |
|
|
3525 |
- All scaffolds now use the ``pyramid_debugtoolbar`` package rather than the |
|
3526 |
``WebError`` package to provide interactive debugging features. |
|
3527 |
|
|
3528 |
- Projects created via a scaffold no longer depend on the ``WebError`` |
|
3529 |
package at all; configuration in the ``production.ini`` file which used to |
|
3530 |
require its ``error_catcher`` middleware has been removed. Configuring |
|
3531 |
error catching / email sending is now the domain of the ``pyramid_exclog`` |
cd8ac8
|
3532 |
package (see http://docs.pylonsproject.org/projects/pyramid_exclog/en/latest/). |
e04cbb
|
3533 |
|
CM |
3534 |
Bug Fixes |
|
3535 |
--------- |
|
3536 |
|
|
3537 |
- Fixed an issue with the default renderer not working at certain times. See |
|
3538 |
https://github.com/Pylons/pyramid/issues/249 |
|
3539 |
|
|
3540 |
|
bd9947
|
3541 |
1.1 (2011-07-22) |
CM |
3542 |
================ |
|
3543 |
|
|
3544 |
Features |
|
3545 |
-------- |
|
3546 |
|
|
3547 |
- Added the ``pyramid.renderers.null_renderer`` object as an API. The null |
|
3548 |
renderer is an object that can be used in advanced integration cases as |
|
3549 |
input to the view configuration ``renderer=`` argument. When the null |
|
3550 |
renderer is used as a view renderer argument, Pyramid avoids converting the |
|
3551 |
view callable result into a Response object. This is useful if you want to |
|
3552 |
reuse the view configuration and lookup machinery outside the context of |
|
3553 |
its use by the Pyramid router. This feature was added for consumption by |
|
3554 |
the ``pyramid_rpc`` package, which uses view configuration and lookup |
|
3555 |
outside the context of a router in exactly this way. ``pyramid_rpc`` has |
|
3556 |
been broken under 1.1 since 1.1b1; adding it allows us to make it work |
|
3557 |
again. |
|
3558 |
|
|
3559 |
- Change all scaffolding templates that point to docs.pylonsproject.org to |
|
3560 |
use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``. |
|
3561 |
|
|
3562 |
Internals |
|
3563 |
--------- |
|
3564 |
|
|
3565 |
- Remove ``compat`` code that served only the purpose of providing backwards |
|
3566 |
compatibility with Python 2.4. |
|
3567 |
|
|
3568 |
- Add a deprecation warning for non-API function |
|
3569 |
``pyramid.renderers.renderer_from_name`` which has seen use in the wild. |
|
3570 |
|
|
3571 |
- Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by |
|
3572 |
the ``pyramid.view.view_config`` decorator. |
|
3573 |
|
|
3574 |
Documentation |
|
3575 |
------------- |
|
3576 |
|
|
3577 |
- Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial. |
|
3578 |
|
|
3579 |
- Reordered chapters in narrative section for better new user friendliness. |
|
3580 |
|
|
3581 |
- Added more indexing markers to sections in documentation. |
|
3582 |
|
|
3583 |
1.1b4 (2011-07-18) |
|
3584 |
================== |
|
3585 |
|
|
3586 |
Documentation |
|
3587 |
------------- |
|
3588 |
|
|
3589 |
- Added a section entitled "Writing a Script" to the "Command-Line Pyramid" |
|
3590 |
chapter. |
|
3591 |
|
|
3592 |
Backwards Incompatibilities |
|
3593 |
--------------------------- |
|
3594 |
|
|
3595 |
- We added the ``pyramid.scripting.make_request`` API too hastily in 1.1b3. |
|
3596 |
It has been removed. Sorry for any inconvenience. Use the |
|
3597 |
``pyramid.request.Request.blank`` API instead. |
|
3598 |
|
|
3599 |
Features |
|
3600 |
-------- |
|
3601 |
|
|
3602 |
- The ``paster pshell``, ``paster pviews``, and ``paster proutes`` commands |
|
3603 |
each now under the hood uses ``pyramid.paster.bootstrap``, which makes it |
|
3604 |
possible to supply an ``.ini`` file without naming the "right" section in |
|
3605 |
the file that points at the actual Pyramid application. Instead, you can |
|
3606 |
generally just run ``paster {pshell|proutes|pviews} development.ini`` and |
|
3607 |
it will do mostly the right thing. |
|
3608 |
|
|
3609 |
Bug Fixes |
|
3610 |
--------- |
|
3611 |
|
|
3612 |
- Omit custom environ variables when rendering a custom exception template in |
|
3613 |
``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``; |
|
3614 |
stringifying thse may trigger code that should not be executed; see |
|
3615 |
https://github.com/Pylons/pyramid/issues/239 |
|
3616 |
|
|
3617 |
1.1b3 (2011-07-15) |
|
3618 |
================== |
|
3619 |
|
|
3620 |
Features |
|
3621 |
-------- |
|
3622 |
|
|
3623 |
- Fix corner case to ease semifunctional testing of views: create a new |
|
3624 |
rendererinfo to clear out old registry on a rescan. See |
|
3625 |
https://github.com/Pylons/pyramid/pull/234. |
|
3626 |
|
|
3627 |
- New API class: ``pyramid.static.static_view``. This supersedes the |
|
3628 |
deprecated ``pyramid.view.static`` class. ``pyramid.static.static_view`` |
|
3629 |
by default serves up documents as the result of the request's |
|
3630 |
``path_info``, attribute rather than it's ``subpath`` attribute (the |
|
3631 |
inverse was true of ``pyramid.view.static``, and still is). |
|
3632 |
``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when |
|
3633 |
you want the static view to behave like the older deprecated version. |
|
3634 |
|
|
3635 |
- A new API function ``pyramid.paster.bootstrap`` has been added to make |
|
3636 |
writing scripts that bootstrap a Pyramid environment easier, e.g.:: |
|
3637 |
|
|
3638 |
from pyramid.paster import bootstrap |
|
3639 |
info = bootstrap('/path/to/my/development.ini') |
|
3640 |
request = info['request'] |
|
3641 |
print request.route_url('myroute') |
|
3642 |
|
|
3643 |
- A new API function ``pyramid.scripting.prepare`` has been added. It is a |
|
3644 |
lower-level analogue of ``pyramid.paster.boostrap`` that accepts a request |
|
3645 |
and a registry instead of a config file argument, and is used for the same |
|
3646 |
purpose:: |
|
3647 |
|
|
3648 |
from pyramid.scripting import prepare |
|
3649 |
info = prepare(registry=myregistry) |
|
3650 |
request = info['request'] |
|
3651 |
print request.route_url('myroute') |
|
3652 |
|
|
3653 |
- A new API function ``pyramid.scripting.make_request`` has been added. The |
|
3654 |
resulting request will have a ``registry`` attribute. It is meant to be |
|
3655 |
used in conjunction with ``pyramid.scripting.prepare`` and/or |
|
3656 |
``pyramid.paster.bootstrap`` (both of which accept a request as an |
|
3657 |
argument):: |
|
3658 |
|
|
3659 |
from pyramid.scripting import make_request |
|
3660 |
request = make_request('/') |
|
3661 |
|
|
3662 |
- New API attribute ``pyramid.config.global_registries`` is an iterable |
|
3663 |
object that contains references to every Pyramid registry loaded into the |
|
3664 |
current process via ``pyramid.config.Configurator.make_app``. It also has |
|
3665 |
a ``last`` attribute containing the last registry loaded. This is used by |
|
3666 |
the scripting machinery, and is available for introspection. |
|
3667 |
|
|
3668 |
Deprecations |
|
3669 |
------------ |
|
3670 |
|
|
3671 |
- The ``pyramid.view.static`` class has been deprecated in favor of the newer |
|
3672 |
``pyramid.static.static_view`` class. A deprecation warning is raised when |
|
3673 |
it is used. You should replace it with a reference to |
|
3674 |
``pyramid.static.static_view`` with the ``use_subpath=True`` argument. |
|
3675 |
|
|
3676 |
Bug Fixes |
|
3677 |
--------- |
|
3678 |
|
|
3679 |
- Without a mo-file loaded for the combination of domain/locale, |
|
3680 |
``pyramid.i18n.Localizer.pluralize`` run using that domain/locale |
|
3681 |
combination raised an inscrutable "translations object has no attr |
|
3682 |
'plural'" error. Now, instead it "works" (it uses a germanic pluralization |
|
3683 |
by default). It's nonsensical to try to pluralize something without |
|
3684 |
translations for that locale/domain available, but this behavior matches |
|
3685 |
the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least |
|
3686 |
consistent; see https://github.com/Pylons/pyramid/issues/235. |
|
3687 |
|
|
3688 |
1.1b2 (2011-07-13) |
|
3689 |
================== |
|
3690 |
|
|
3691 |
Features |
|
3692 |
-------- |
|
3693 |
|
|
3694 |
- New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new |
|
3695 |
configuration file value ``prevent_http_cache``. These are synomymous and |
|
3696 |
allow you to prevent HTTP cache headers from being set by Pyramid's |
|
3697 |
``http_cache`` machinery globally in a process. see the "Influencing HTTP |
|
3698 |
Caching" section of the "View Configuration" narrative chapter and the |
|
3699 |
detailed documentation for this setting in the "Environment Variables and |
|
3700 |
Configuration Settings" narrative chapter. |
|
3701 |
|
|
3702 |
Behavior Changes |
|
3703 |
---------------- |
|
3704 |
|
|
3705 |
- Previously, If a ``BeforeRender`` event subscriber added a value via the |
|
3706 |
``__setitem__`` or ``update`` methods of the event object with a key that |
|
3707 |
already existed in the renderer globals dictionary, a ``KeyError`` was |
|
3708 |
raised. With the deprecation of the "add_renderer_globals" feature of the |
|
3709 |
configurator, there was no way to override an existing value in the |
|
3710 |
renderer globals dictionary that already existed. Now, the event object |
|
3711 |
will overwrite an older value that is already in the globals dictionary |
|
3712 |
when its ``__setitem__`` or ``update`` is called (as well as the new |
|
3713 |
``setdefault`` method), just like a plain old dictionary. As a result, for |
|
3714 |
maximum interoperability with other third-party subscribers, if you write |
|
3715 |
an event subscriber meant to be used as a BeforeRender subscriber, your |
|
3716 |
subscriber code will now need to (using ``.get`` or ``__contains__`` of the |
|
3717 |
event object) ensure no value already exists in the renderer globals |
|
3718 |
dictionary before setting an overriding value. |
|
3719 |
|
|
3720 |
Bug Fixes |
|
3721 |
--------- |
|
3722 |
|
|
3723 |
- The ``Configurator.add_route`` method allowed two routes with the same |
|
3724 |
route to be added without an intermediate ``config.commit()``. If you now |
|
3725 |
receive a ``ConfigurationError`` at startup time that appears to be |
|
3726 |
``add_route`` related, you'll need to either a) ensure that all of your |
|
3727 |
route names are unique or b) call ``config.commit()`` before adding a |
|
3728 |
second route with the name of a previously added name or c) use a |
|
3729 |
Configurator that works in ``autocommit`` mode. |
|
3730 |
|
|
3731 |
- The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds |
|
3732 |
inappropriately used ``DBSession.rollback()`` instead of |
|
3733 |
``transaction.abort()`` in one place. |
|
3734 |
|
|
3735 |
- We now clear ``request.response`` before we invoke an exception view; an |
|
3736 |
exception view will be working with a request.response that has not been |
|
3737 |
touched by any code prior to the exception. |
|
3738 |
|
|
3739 |
- Views associated with routes with spaces in the route name may not have |
|
3740 |
been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4 |
|
3741 |
and better. See https://github.com/Pylons/pyramid/issues/232. |
|
3742 |
|
|
3743 |
Documentation |
|
3744 |
------------- |
|
3745 |
|
|
3746 |
- Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't |
|
3747 |
match the ``pyramid_routesalchemy`` scaffold function of the same name; it |
|
3748 |
didn't get synchronized when it was changed in the scaffold. |
|
3749 |
|
|
3750 |
- New documentation section in View Configuration narrative chapter: |
|
3751 |
"Influencing HTTP Caching". |
|
3752 |
|
|
3753 |
1.1b1 (2011-07-10) |
|
3754 |
================== |
|
3755 |
|
|
3756 |
Features |
|
3757 |
-------- |
|
3758 |
|
|
3759 |
- It is now possible to invoke ``paster pshell`` even if the paste ini file |
|
3760 |
section name pointed to in its argument is not actually a Pyramid WSGI |
|
3761 |
application. The shell will work in a degraded mode, and will warn the |
|
3762 |
user. See "The Interactive Shell" in the "Creating a Pyramid Project" |
|
3763 |
narrative documentation section. |
|
3764 |
|
|
3765 |
- ``paster pshell`` now offers more built-in global variables by default |
|
3766 |
(including ``app`` and ``settings``). See "The Interactive Shell" in the |
|
3767 |
"Creating a Pyramid Project" narrative documentation section. |
|
3768 |
|
|
3769 |
- It is now possible to add a ``[pshell]`` section to your application's .ini |
|
3770 |
configuration file, which influences the global names available to a pshell |
|
3771 |
session. See "Extending the Shell" in the "Creating a Pyramid Project" |
|
3772 |
narrative documentation chapter. |
|
3773 |
|
|
3774 |
- The ``config.scan`` method has grown a ``**kw`` argument. ``kw`` argument |
|
3775 |
represents a set of keyword arguments to pass to the Venusian ``Scanner`` |
|
3776 |
object created by Pyramid. (See the Venusian documentation for more |
|
3777 |
information about ``Scanner``). |
|
3778 |
|
|
3779 |
- New request property: ``json_body``. This property will return the |
|
3780 |
JSON-decoded variant of the request body. If the request body is not |
|
3781 |
well-formed JSON, this property will raise an exception. |
|
3782 |
|
|
3783 |
- A new value ``http_cache`` can be used as a view configuration |
|
3784 |
parameter. |
|
3785 |
|
|
3786 |
When you supply an ``http_cache`` value to a view configuration, the |
|
3787 |
``Expires`` and ``Cache-Control`` headers of a response generated by the |
|
3788 |
associated view callable are modified. The value for ``http_cache`` may be |
|
3789 |
one of the following: |
|
3790 |
|
|
3791 |
- A nonzero integer. If it's a nonzero integer, it's treated as a number |
|
3792 |
of seconds. This number of seconds will be used to compute the |
|
3793 |
``Expires`` header and the ``Cache-Control: max-age`` parameter of |
|
3794 |
responses to requests which call this view. For example: |
|
3795 |
``http_cache=3600`` instructs the requesting browser to 'cache this |
|
3796 |
response for an hour, please'. |
|
3797 |
|
|
3798 |
- A ``datetime.timedelta`` instance. If it's a ``datetime.timedelta`` |
|
3799 |
instance, it will be converted into a number of seconds, and that number |
|
3800 |
of seconds will be used to compute the ``Expires`` header and the |
|
3801 |
``Cache-Control: max-age`` parameter of responses to requests which call |
|
3802 |
this view. For example: ``http_cache=datetime.timedelta(days=1)`` |
|
3803 |
instructs the requesting browser to 'cache this response for a day, |
|
3804 |
please'. |
|
3805 |
|
|
3806 |
- Zero (``0``). If the value is zero, the ``Cache-Control`` and |
|
3807 |
``Expires`` headers present in all responses from this view will be |
|
3808 |
composed such that client browser cache (and any intermediate caches) are |
|
3809 |
instructed to never cache the response. |
|
3810 |
|
|
3811 |
- A two-tuple. If it's a two tuple (e.g. ``http_cache=(1, |
|
3812 |
{'public':True})``), the first value in the tuple may be a nonzero |
|
3813 |
integer or a ``datetime.timedelta`` instance; in either case this value |
|
3814 |
will be used as the number of seconds to cache the response. The second |
|
3815 |
value in the tuple must be a dictionary. The values present in the |
|
3816 |
dictionary will be used as input to the ``Cache-Control`` response |
|
3817 |
header. For example: ``http_cache=(3600, {'public':True})`` means 'cache |
|
3818 |
for an hour, and add ``public`` to the Cache-Control header of the |
|
3819 |
response'. All keys and values supported by the |
|
3820 |
``webob.cachecontrol.CacheControl`` interface may be added to the |
|
3821 |
dictionary. Supplying ``{'public':True}`` is equivalent to calling |
|
3822 |
``response.cache_control.public = True``. |
|
3823 |
|
|
3824 |
Providing a non-tuple value as ``http_cache`` is equivalent to calling |
|
3825 |
``response.cache_expires(value)`` within your view's body. |
|
3826 |
|
|
3827 |
Providing a two-tuple value as ``http_cache`` is equivalent to calling |
|
3828 |
``response.cache_expires(value[0], **value[1])`` within your view's body. |
|
3829 |
|
|
3830 |
If you wish to avoid influencing, the ``Expires`` header, and instead wish |
|
3831 |
to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache`` |
|
3832 |
with the first element of ``None``, e.g.: ``(None, {'public':True})``. |
|
3833 |
|
|
3834 |
Bug Fixes |
|
3835 |
--------- |
|
3836 |
|
|
3837 |
- Framework wrappers of the original view (such as http_cached and so on) |
|
3838 |
relied on being able to trust that the response they were receiving was an |
|
3839 |
IResponse. It wasn't always, because the response was resolved by the |
|
3840 |
router instead of early in the view wrapping process. This has been fixed. |
|
3841 |
|
|
3842 |
Documentation |
|
3843 |
------------- |
|
3844 |
|
|
3845 |
- Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded |
|
3846 |
Request Body" (usage of ``request.json_body``). |
|
3847 |
|
|
3848 |
Behavior Changes |
|
3849 |
---------------- |
|
3850 |
|
|
3851 |
- The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands |
|
3852 |
now take a single argument in the form ``/path/to/config.ini#sectionname`` |
|
3853 |
rather than the previous 2-argument spelling ``/path/to/config.ini |
|
3854 |
sectionname``. ``#sectionname`` may be omitted, in which case ``#main`` is |
|
3855 |
assumed. |
|
3856 |
|
|
3857 |
1.1a4 (2011-07-01) |
|
3858 |
================== |
|
3859 |
|
|
3860 |
Bug Fixes |
|
3861 |
--------- |
|
3862 |
|
|
3863 |
- ``pyramid.testing.DummyRequest`` now raises deprecation warnings when |
|
3864 |
attributes deprecated for ``pyramid.request.Request`` are accessed (like |
|
3865 |
``response_content_type``). This is for the benefit of folks running unit |
|
3866 |
tests which use DummyRequest instead of a "real" request, so they know |
|
3867 |
things are deprecated without necessarily needing a functional test suite. |
|
3868 |
|
|
3869 |
- The ``pyramid.events.subscriber`` directive behaved contrary to the |
|
3870 |
documentation when passed more than one interface object to its |
|
3871 |
constructor. For example, when the following listener was registered:: |
|
3872 |
|
|
3873 |
@subscriber(IFoo, IBar) |
|
3874 |
def expects_ifoo_events_and_ibar_events(event): |
|
3875 |
print event |
|
3876 |
|
|
3877 |
The Events chapter docs claimed that the listener would be registered and |
|
3878 |
listening for both ``IFoo`` and ``IBar`` events. Instead, it registered an |
|
3879 |
"object event" subscriber which would only be called if an IObjectEvent was |
|
3880 |
emitted where the object interface was ``IFoo`` and the event interface was |
|
3881 |
``IBar``. |
|
3882 |
|
|
3883 |
The behavior now matches the documentation. If you were relying on the |
|
3884 |
buggy behavior of the 1.0 ``subscriber`` directive in order to register an |
|
3885 |
object event subscriber, you must now pass a sequence to indicate you'd |
|
3886 |
like to register a subscriber for an object event. e.g.:: |
|
3887 |
|
|
3888 |
@subscriber([IFoo, IBar]) |
|
3889 |
def expects_object_event(object, event): |
|
3890 |
print object, event |
|
3891 |
|
|
3892 |
Features |
|
3893 |
-------- |
|
3894 |
|
|
3895 |
- Add JSONP renderer (see "JSONP renderer" in the Renderers chapter of the |
|
3896 |
documentation). |
|
3897 |
|
|
3898 |
Deprecations |
|
3899 |
------------ |
|
3900 |
|
|
3901 |
- Deprecated the ``set_renderer_globals_factory`` method of the Configurator |
|
3902 |
and the ``renderer_globals`` Configurator constructor parameter. |
|
3903 |
|
|
3904 |
Documentation |
|
3905 |
------------- |
|
3906 |
|
|
3907 |
- The Wiki and Wiki2 tutorial "Tests" chapters each had two bugs: neither did |
|
3908 |
told the user to depend on WebTest, and 2 tests failed in each as the |
|
3909 |
result of changes to Pyramid itself. These issues have been fixed. |
|
3910 |
|
|
3911 |
- Move 1.0.X CHANGES.txt entries to HISTORY.txt. |
|
3912 |
|
|
3913 |
1.1a3 (2011-06-26) |
|
3914 |
================== |
|
3915 |
|
|
3916 |
Features |
|
3917 |
-------- |
|
3918 |
|
|
3919 |
- Added ``mako.preprocessor`` config file parameter; allows for a Mako |
|
3920 |
preprocessor to be specified as a Python callable or Python dotted name. |
|
3921 |
See https://github.com/Pylons/pyramid/pull/183 for rationale. |
|
3922 |
|
|
3923 |
Bug fixes |
|
3924 |
--------- |
|
3925 |
|
|
3926 |
- Pyramid would raise an AttributeError in the Configurator when attempting |
|
3927 |
to set a ``__text__`` attribute on a custom predicate that was actually a |
|
3928 |
classmethod. See https://github.com/Pylons/pyramid/pull/217 . |
|
3929 |
|
|
3930 |
- Accessing or setting deprecated response_* attrs on request |
|
3931 |
(e.g. ``response_content_type``) now issues a deprecation warning at access |
|
3932 |
time rather than at rendering time. |
|
3933 |
|
|
3934 |
1.1a2 (2011-06-22) |
|
3935 |
================== |
|
3936 |
|
|
3937 |
Bug Fixes |
|
3938 |
--------- |
|
3939 |
|
|
3940 |
- 1.1a1 broke Akhet by not providing a backwards compatibility import shim |
|
3941 |
for ``pyramid.paster.PyramidTemplate``. Now one has been added, although a |
|
3942 |
deprecation warning is emitted when Akhet imports it. |
|
3943 |
|
|
3944 |
- If multiple specs were provided in a single call to |
|
3945 |
``config.add_translation_dirs``, the directories were inserted into the |
|
3946 |
beginning of the directory list in the wrong order: they were inserted in |
|
3947 |
the reverse of the order they were provided in the ``*specs`` list (items |
|
3948 |
later in the list were added before ones earlier in the list). This is now |
|
3949 |
fixed. |
|
3950 |
|
|
3951 |
Backwards Incompatibilities |
|
3952 |
--------------------------- |
|
3953 |
|
|
3954 |
- The pyramid Router attempted to set a value into the key |
|
3955 |
``environ['repoze.bfg.message']`` when it caught a view-related exception |
|
3956 |
for backwards compatibility with applications written for ``repoze.bfg`` |
|
3957 |
during error handling. It did this by using code that looked like so:: |
|
3958 |
|
|
3959 |
# "why" is an exception object |
|
3960 |
try: |
|
3961 |
msg = why[0] |
|
3962 |
except: |
|
3963 |
msg = '' |
|
3964 |
|
|
3965 |
environ['repoze.bfg.message'] = msg |
|
3966 |
|
|
3967 |
Use of the value ``environ['repoze.bfg.message']`` was docs-deprecated in |
|
3968 |
Pyramid 1.0. Our standing policy is to not remove features after a |
|
3969 |
deprecation for two full major releases, so this code was originally slated |
|
3970 |
to be removed in Pyramid 1.2. However, computing the |
|
3971 |
``repoze.bfg.message`` value was the source of at least one bug found in |
|
3972 |
the wild (https://github.com/Pylons/pyramid/issues/199), and there isn't a |
|
3973 |
foolproof way to both preserve backwards compatibility and to fix the bug. |
|
3974 |
Therefore, the code which sets the value has been removed in this release. |
|
3975 |
Code in exception views which relies on this value's presence in the |
|
3976 |
environment should now use the ``exception`` attribute of the request |
|
3977 |
(e.g. ``request.exception[0]``) to retrieve the message instead of relying |
|
3978 |
on ``request.environ['repoze.bfg.message']``. |
|
3979 |
|
|
3980 |
1.1a1 (2011-06-20) |
|
3981 |
================== |
|
3982 |
|
|
3983 |
Documentation |
|
3984 |
------------- |
|
3985 |
|
|
3986 |
- The term "template" used to refer to both "paster templates" and "rendered |
|
3987 |
templates" (templates created by a rendering engine. i.e. Mako, Chameleon, |
|
3988 |
Jinja, etc.). "Paster templates" will now be refered to as "scaffolds", |
|
3989 |
whereas the name for "rendered templates" will remain as "templates." |
|
3990 |
|
|
3991 |
- The ``wiki`` (ZODB+Traversal) tutorial was updated slightly. |
|
3992 |
|
|
3993 |
- The ``wiki2`` (SQLA+URL Dispatch) tutorial was updated slightly. |
|
3994 |
|
|
3995 |
- Make ``pyramid.interfaces.IAuthenticationPolicy`` and |
|
3996 |
``pyramid.interfaces.IAuthorizationPolicy`` public interfaces, and refer to |
|
3997 |
them within the ``pyramid.authentication`` and ``pyramid.authorization`` |
|
3998 |
API docs. |
|
3999 |
|
|
4000 |
- Render the function definitions for each exposed interface in |
|
4001 |
``pyramid.interfaces``. |
|
4002 |
|
|
4003 |
- Add missing docs reference to |
|
4004 |
``pyramid.config.Configurator.set_view_mapper`` and refer to it within |
|
4005 |
Hooks chapter section named "Using a View Mapper". |
|
4006 |
|
|
4007 |
- Added section to the "Environment Variables and ``.ini`` File Settings" |
|
4008 |
chapter in the narrative documentation section entitled "Adding a Custom |
|
4009 |
Setting". |
|
4010 |
|
|
4011 |
- Added documentation for a "multidict" (e.g. the API of ``request.POST``) as |
|
4012 |
interface API documentation. |
|
4013 |
|
|
4014 |
- Added a section to the "URL Dispatch" narrative chapter regarding the new |
|
4015 |
"static" route feature. |
|
4016 |
|
|
4017 |
- Added "What's New in Pyramid 1.1" to HTML rendering of documentation. |
|
4018 |
|
|
4019 |
- Added API docs for ``pyramid.authentication.SessionAuthenticationPolicy``. |
|
4020 |
|
|
4021 |
- Added API docs for ``pyramid.httpexceptions.exception_response``. |
|
4022 |
|
|
4023 |
- Added "HTTP Exceptions" section to Views narrative chapter including a |
|
4024 |
description of ``pyramid.httpexceptions.exception_response``. |
|
4025 |
|
|
4026 |
Features |
|
4027 |
-------- |
|
4028 |
|
|
4029 |
- Add support for language fallbacks: when trying to translate for a |
|
4030 |
specific territory (such as ``en_GB``) fall back to translations |
|
4031 |
for the language (ie ``en``). This brings the translation behaviour in line |
|
4032 |
with GNU gettext and fixes partially translated texts when using C |
|
4033 |
extensions. |
|
4034 |
|
|
4035 |
- New authentication policy: |
|
4036 |
``pyramid.authentication.SessionAuthenticationPolicy``, which uses a session |
|
4037 |
to store credentials. |
|
4038 |
|
|
4039 |
- Accessing the ``response`` attribute of a ``pyramid.request.Request`` |
|
4040 |
object (e.g. ``request.response`` within a view) now produces a new |
|
4041 |
``pyramid.response.Response`` object. This feature is meant to be used |
|
4042 |
mainly when a view configured with a renderer needs to set response |
|
4043 |
attributes: all renderers will use the Response object implied by |
|
4044 |
``request.response`` as the response object returned to the router. |
|
4045 |
|
|
4046 |
``request.response`` can also be used by code in a view that does not use a |
|
4047 |
renderer, however the response object that is produced by |
|
4048 |
``request.response`` must be returned when a renderer is not in play (it is |
|
4049 |
not a "global" response). |
|
4050 |
|
|
4051 |
- Integers and longs passed as ``elements`` to ``pyramid.url.resource_url`` |
|
4052 |
or ``pyramid.request.Request.resource_url`` e.g. ``resource_url(context, |
|
4053 |
request, 1, 2)`` (``1`` and ``2`` are the ``elements``) will now be |
|
4054 |
converted implicitly to strings in the result. Previously passing integers |
|
4055 |
or longs as elements would cause a TypeError. |
|
4056 |
|
|
4057 |
- ``pyramid_alchemy`` paster template now uses ``query.get`` rather than |
|
4058 |
``query.filter_by`` to take better advantage of identity map caching. |
|
4059 |
|
|
4060 |
- ``pyramid_alchemy`` paster template now has unit tests. |
|
4061 |
|
|
4062 |
- Added ``pyramid.i18n.make_localizer`` API (broken out from |
|
4063 |
``get_localizer`` guts). |
|
4064 |
|
|
4065 |
- An exception raised by a NewRequest event subscriber can now be caught by |
|
4066 |
an exception view. |
|
4067 |
|
|
4068 |
- It is now possible to get information about why Pyramid raised a Forbidden |
|
4069 |
exception from within an exception view. The ``ACLDenied`` object returned |
|
4070 |
by the ``permits`` method of each stock authorization policy |
|
4071 |
(``pyramid.interfaces.IAuthorizationPolicy.permits``) is now attached to |
|
4072 |
the Forbidden exception as its ``result`` attribute. Therefore, if you've |
|
4073 |
created a Forbidden exception view, you can see the ACE, ACL, permission, |
|
4074 |
and principals involved in the request as |
|
4075 |
eg. ``context.result.permission``, ``context.result.acl``, etc within the |
|
4076 |
logic of the Forbidden exception view. |
|
4077 |
|
|
4078 |
- Don't explicitly prevent the ``timeout`` from being lower than the |
|
4079 |
``reissue_time`` when setting up an ``AuthTktAuthenticationPolicy`` |
|
4080 |
(previously such a configuration would raise a ``ValueError``, now it's |
|
4081 |
allowed, although typically nonsensical). Allowing the nonsensical |
|
4082 |
configuration made the code more understandable and required fewer tests. |
|
4083 |
|
|
4084 |
- A new paster command named ``paster pviews`` was added. This command |
|
4085 |
prints a summary of potentially matching views for a given path. See the |
|
4086 |
section entitled "Displaying Matching Views for a Given URL" in the "View |
|
4087 |
Configuration" chapter of the narrative documentation for more information. |
|
4088 |
|
|
4089 |
- The ``add_route`` method of the Configurator now accepts a ``static`` |
|
4090 |
argument. If this argument is ``True``, the added route will never be |
|
4091 |
considered for matching when a request is handled. Instead, it will only |
|
4092 |
be useful for URL generation via ``route_url`` and ``route_path``. See the |
|
4093 |
section entitled "Static Routes" in the URL Dispatch narrative chapter for |
|
4094 |
more information. |
|
4095 |
|
|
4096 |
- A default exception view for the context |
|
4097 |
``pyramid.interfaces.IExceptionResponse`` is now registered by default. |
|
4098 |
This means that an instance of any exception response class imported from |
|
4099 |
``pyramid.httpexceptions`` (such as ``HTTPFound``) can now be raised from |
|
4100 |
within view code; when raised, this exception view will render the |
|
4101 |
exception to a response. |
|
4102 |
|
|
4103 |
- A function named ``pyramid.httpexceptions.exception_response`` is a |
|
4104 |
shortcut that can be used to create HTTP exception response objects using |
|
4105 |
an HTTP integer status code. |
|
4106 |
|
|
4107 |
- The Configurator now accepts an additional keyword argument named |
|
4108 |
``exceptionresponse_view``. By default, this argument is populated with a |
|
4109 |
default exception view function that will be used when a response is raised |
|
4110 |
as an exception. When ``None`` is passed for this value, an exception view |
|
4111 |
for responses will not be registered. Passing ``None`` returns the |
|
4112 |
behavior of raising an HTTP exception to that of Pyramid 1.0 (the exception |
|
4113 |
will propagate to middleware and to the WSGI server). |
|
4114 |
|
|
4115 |
- The ``pyramid.request.Request`` class now has a ``ResponseClass`` interface |
|
4116 |
which points at ``pyramid.response.Response``. |
|
4117 |
|
|
4118 |
- The ``pyramid.response.Response`` class now has a ``RequestClass`` |
|
4119 |
interface which points at ``pyramid.request.Request``. |
|
4120 |
|
|
4121 |
- It is now possible to return an arbitrary object from a Pyramid view |
|
4122 |
callable even if a renderer is not used, as long as a suitable adapter to |
|
4123 |
``pyramid.interfaces.IResponse`` is registered for the type of the returned |
|
4124 |
object by using the new |
|
4125 |
``pyramid.config.Configurator.add_response_adapter`` API. See the section |
|
4126 |
in the Hooks chapter of the documentation entitled "Changing How Pyramid |
|
4127 |
Treats View Responses". |
|
4128 |
|
|
4129 |
- The Pyramid router will now, by default, call the ``__call__`` method of |
|
4130 |
WebOb response objects when returning a WSGI response. This means that, |
|
4131 |
among other things, the ``conditional_response`` feature of WebOb response |
|
4132 |
objects will now behave properly. |
|
4133 |
|
|
4134 |
- New method named ``pyramid.request.Request.is_response``. This method |
|
4135 |
should be used instead of the ``pyramid.view.is_response`` function, which |
|
4136 |
has been deprecated. |
|
4137 |
|
|
4138 |
Bug Fixes |
|
4139 |
--------- |
|
4140 |
|
|
4141 |
- URL pattern markers used in URL dispatch are permitted to specify a custom |
|
4142 |
regex. For example, the pattern ``/{foo:\d+}`` means to match ``/12345`` |
|
4143 |
(foo==12345 in the match dictionary) but not ``/abc``. However, custom |
|
4144 |
regexes in a pattern marker which used squiggly brackets did not work. For |
|
4145 |
example, ``/{foo:\d{4}}`` would fail to match ``/1234`` and |
|
4146 |
``/{foo:\d{1,2}}`` would fail to match ``/1`` or ``/11``. One level of |
|
4147 |
inner squiggly brackets is now recognized so that the prior two patterns |
|
4148 |
given as examples now work. See also |
|
4149 |
https://github.com/Pylons/pyramid/issues/#issue/123. |
|
4150 |
|
|
4151 |
- Don't send port numbers along with domain information in cookies set by |
|
4152 |
AuthTktCookieHelper (see https://github.com/Pylons/pyramid/issues/131). |
|
4153 |
|
|
4154 |
- ``pyramid.url.route_path`` (and the shortcut |
|
4155 |
``pyramid.request.Request.route_url`` method) now include the WSGI |
|
4156 |
SCRIPT_NAME at the front of the path if it is not empty (see |
|
4157 |
https://github.com/Pylons/pyramid/issues/135). |
|
4158 |
|
|
4159 |
- ``pyramid.testing.DummyRequest`` now has a ``script_name`` attribute (the |
|
4160 |
empty string). |
|
4161 |
|
|
4162 |
- Don't quote ``:@&+$,`` symbols in ``*elements`` passed to |
|
4163 |
``pyramid.url.route_url`` or ``pyramid.url.resource_url`` (see |
|
4164 |
https://github.com/Pylons/pyramid/issues#issue/141). |
|
4165 |
|
|
4166 |
- Include SCRIPT_NAME in redirects issued by |
|
4167 |
``pyramid.view.append_slash_notfound_view`` (see |
|
4168 |
https://github.com/Pylons/pyramid/issues#issue/149). |
|
4169 |
|
|
4170 |
- Static views registered with ``config.add_static_view`` which also included |
|
4171 |
a ``permission`` keyword argument would not work as expected, because |
|
4172 |
``add_static_view`` also registered a route factory internally. Because a |
|
4173 |
route factory was registered internally, the context checked by the Pyramid |
|
4174 |
permission machinery never had an ACL. ``add_static_view`` no longer |
|
4175 |
registers a route with a factory, so the default root factory will be used. |
|
4176 |
|
|
4177 |
- ``config.add_static_view`` now passes extra keyword arguments it receives |
|
4178 |
to ``config.add_route`` (calling add_static_view is mostly logically |
|
4179 |
equivalent to adding a view of the type ``pyramid.static.static_view`` |
|
4180 |
hooked up to a route with a subpath). This makes it possible to pass e.g., |
|
4181 |
``factory=`` to ``add_static_view`` to protect a particular static view |
|
4182 |
with a custom ACL. |
|
4183 |
|
|
4184 |
- ``testing.DummyRequest`` used the wrong registry (the global registry) as |
|
4185 |
``self.registry`` if a dummy request was created *before* ``testing.setUp`` |
|
4186 |
was executed (``testing.setUp`` pushes a local registry onto the |
|
4187 |
threadlocal stack). Fixed by implementing ``registry`` as a property for |
|
4188 |
DummyRequest instead of eagerly assigning an attribute. |
|
4189 |
See also https://github.com/Pylons/pyramid/issues/165 |
|
4190 |
|
|
4191 |
- When visiting a URL that represented a static view which resolved to a |
|
4192 |
subdirectory, the ``index.html`` of that subdirectory would not be served |
|
4193 |
properly. Instead, a redirect to ``/subdir`` would be issued. This has |
|
4194 |
been fixed, and now visiting a subdirectory that contains an ``index.html`` |
|
4195 |
within a static view returns the index.html properly. See also |
|
4196 |
https://github.com/Pylons/pyramid/issues/67. |
|
4197 |
|
|
4198 |
- Redirects issued by a static view did not take into account any existing |
|
4199 |
``SCRIPT_NAME`` (such as one set by a url mapping composite). Now they do. |
|
4200 |
|
|
4201 |
- The ``pyramid.wsgi.wsgiapp2`` decorator did not take into account the |
|
4202 |
``SCRIPT_NAME`` in the origin request. |
|
4203 |
|
|
4204 |
- The ``pyramid.wsgi.wsgiapp2`` decorator effectively only worked when it |
|
4205 |
decorated a view found via traversal; it ignored the ``PATH_INFO`` that was |
|
4206 |
part of a url-dispatch-matched view. |
|
4207 |
|
|
4208 |
Deprecations |
|
4209 |
------------ |
|
4210 |
|
|
4211 |
- Deprecated all assignments to ``request.response_*`` attributes (for |
|
4212 |
example ``request.response_content_type = 'foo'`` is now deprecated). |
|
4213 |
Assignments and mutations of assignable request attributes that were |
|
4214 |
considered by the framework for response influence are now deprecated: |
|
4215 |
``response_content_type``, ``response_headerlist``, ``response_status``, |
|
4216 |
``response_charset``, and ``response_cache_for``. Instead of assigning |
|
4217 |
these to the request object for later detection by the rendering machinery, |
|
4218 |
users should use the appropriate API of the Response object created by |
|
4219 |
accessing ``request.response`` (e.g. code which does |
|
4220 |
``request.response_content_type = 'abc'`` should be changed to |
|
4221 |
``request.response.content_type = 'abc'``). |
|
4222 |
|
|
4223 |
- Passing view-related parameters to |
|
4224 |
``pyramid.config.Configurator.add_route`` is now deprecated. Previously, a |
|
4225 |
view was permitted to be connected to a route using a set of ``view*`` |
|
4226 |
parameters passed to the ``add_route`` method of the Configurator. This |
|
4227 |
was a shorthand which replaced the need to perform a subsequent call to |
|
4228 |
``add_view``. For example, it was valid (and often recommended) to do:: |
|
4229 |
|
|
4230 |
config.add_route('home', '/', view='mypackage.views.myview', |
|
4231 |
view_renderer='some/renderer.pt') |
|
4232 |
|
|
4233 |
Passing ``view*`` arguments to ``add_route`` is now deprecated in favor of |
|
4234 |
connecting a view to a predefined route via ``Configurator.add_view`` using |
|
4235 |
the route's ``route_name`` parameter. As a result, the above example |
|
4236 |
should now be spelled:: |
|
4237 |
|
|
4238 |
config.add_route('home', '/') |
|
4239 |
config.add_view('mypackage.views.myview', route_name='home') |
|
4240 |
renderer='some/renderer.pt') |
|
4241 |
|
|
4242 |
This deprecation was done to reduce confusion observed in IRC, as well as |
|
4243 |
to (eventually) reduce documentation burden (see also |
|
4244 |
https://github.com/Pylons/pyramid/issues/164). A deprecation warning is |
|
4245 |
now issued when any view-related parameter is passed to |
|
4246 |
``Configurator.add_route``. |
|
4247 |
|
|
4248 |
- Passing an ``environ`` dictionary to the ``__call__`` method of a |
|
4249 |
"traverser" (e.g. an object that implements |
|
4250 |
``pyramid.interfaces.ITraverser`` such as an instance of |
|
4251 |
``pyramid.traversal.ResourceTreeTraverser``) as its ``request`` argument |
|
4252 |
now causes a deprecation warning to be emitted. Consumer code should pass a |
|
4253 |
``request`` object instead. The fact that passing an environ dict is |
|
4254 |
permitted has been documentation-deprecated since ``repoze.bfg`` 1.1, and |
|
4255 |
this capability will be removed entirely in a future version. |
|
4256 |
|
|
4257 |
- The following (undocumented, dictionary-like) methods of the |
|
4258 |
``pyramid.request.Request`` object have been deprecated: ``__contains__``, |
|
4259 |
``__delitem__``, ``__getitem__``, ``__iter__``, ``__setitem__``, ``get``, |
|
4260 |
``has_key``, ``items``, ``iteritems``, ``itervalues``, ``keys``, ``pop``, |
|
4261 |
``popitem``, ``setdefault``, ``update``, and ``values``. Usage of any of |
|
4262 |
these methods will cause a deprecation warning to be emitted. These |
|
4263 |
methods were added for internal compatibility in ``repoze.bfg`` 1.1 (code |
|
4264 |
that currently expects a request object expected an environ object in BFG |
|
4265 |
1.0 and before). In a future version, these methods will be removed |
|
4266 |
entirely. |
|
4267 |
|
|
4268 |
- Deprecated ``pyramid.view.is_response`` function in favor of (newly-added) |
|
4269 |
``pyramid.request.Request.is_response`` method. Determining if an object |
|
4270 |
is truly a valid response object now requires access to the registry, which |
|
4271 |
is only easily available as a request attribute. The |
|
4272 |
``pyramid.view.is_response`` function will still work until it is removed, |
|
4273 |
but now may return an incorrect answer under some (very uncommon) |
|
4274 |
circumstances. |
|
4275 |
|
|
4276 |
Behavior Changes |
|
4277 |
---------------- |
|
4278 |
|
|
4279 |
- The default Mako renderer is now configured to escape all HTML in |
|
4280 |
expression tags. This is intended to help prevent XSS attacks caused by |
|
4281 |
rendering unsanitized input from users. To revert this behavior in user's |
|
4282 |
templates, they need to filter the expression through the 'n' filter. |
|
4283 |
For example, ${ myhtml | n }. |
|
4284 |
See https://github.com/Pylons/pyramid/issues/193. |
|
4285 |
|
|
4286 |
- A custom request factory is now required to return a request object that |
|
4287 |
has a ``response`` attribute (or "reified"/lazy property) if they the |
|
4288 |
request is meant to be used in a view that uses a renderer. This |
|
4289 |
``response`` attribute should be an instance of the class |
|
4290 |
``pyramid.response.Response``. |
|
4291 |
|
|
4292 |
- The JSON and string renderer factories now assign to |
|
4293 |
``request.response.content_type`` rather than |
|
4294 |
``request.response_content_type``. |
|
4295 |
|
|
4296 |
- Each built-in renderer factory now determines whether it should change the |
|
4297 |
content type of the response by comparing the response's content type |
|
4298 |
against the response's default content type; if the content type is the |
|
4299 |
default content type (usually ``text/html``), the renderer changes the |
|
4300 |
content type (to ``application/json`` or ``text/plain`` for JSON and string |
|
4301 |
renderers respectively). |
|
4302 |
|
|
4303 |
- The ``pyramid.wsgi.wsgiapp2`` now uses a slightly different method of |
|
4304 |
figuring out how to "fix" ``SCRIPT_NAME`` and ``PATH_INFO`` for the |
|
4305 |
downstream application. As a result, those values may differ slightly from |
|
4306 |
the perspective of the downstream application (for example, ``SCRIPT_NAME`` |
|
4307 |
will now never possess a trailing slash). |
|
4308 |
|
|
4309 |
- Previously, ``pyramid.request.Request`` inherited from |
|
4310 |
``webob.request.Request`` and implemented ``__getattr__``, ``__setattr__`` |
|
4311 |
and ``__delattr__`` itself in order to overidde "adhoc attr" WebOb behavior |
|
4312 |
where attributes of the request are stored in the environ. Now, |
|
4313 |
``pyramid.request.Request`` object inherits from (the more recent) |
|
4314 |
``webob.request.BaseRequest`` instead of ``webob.request.Request``, which |
|
4315 |
provides the same behavior. ``pyramid.request.Request`` no longer |
|
4316 |
implements its own ``__getattr__``, ``__setattr__`` or ``__delattr__`` as a |
|
4317 |
result. |
|
4318 |
|
|
4319 |
- ``pyramid.response.Response`` is now a *subclass* of |
|
4320 |
``webob.response.Response`` (in order to directly implement the |
|
4321 |
``pyramid.interfaces.IResponse`` interface). |
|
4322 |
|
|
4323 |
- The "exception response" objects importable from ``pyramid.httpexceptions`` |
|
4324 |
(e.g. ``HTTPNotFound``) are no longer just import aliases for classes that |
|
4325 |
actually live in ``webob.exc``. Instead, we've defined our own exception |
|
4326 |
classes within the module that mirror and emulate the ``webob.exc`` |
|
4327 |
exception response objects almost entirely. See the "Design Defense" doc |
|
4328 |
section named "Pyramid Uses its Own HTTP Exception Classes" for more |
|
4329 |
information. |
|
4330 |
|
|
4331 |
Backwards Incompatibilities |
|
4332 |
--------------------------- |
|
4333 |
|
|
4334 |
- Pyramid no longer supports Python 2.4. Python 2.5 or better is required to |
|
4335 |
run Pyramid 1.1+. |
|
4336 |
|
|
4337 |
- The Pyramid router now, by default, expects response objects returned from |
|
4338 |
view callables to implement the ``pyramid.interfaces.IResponse`` interface. |
|
4339 |
Unlike the Pyramid 1.0 version of this interface, objects which implement |
|
4340 |
IResponse now must define a ``__call__`` method that accepts ``environ`` |
|
4341 |
and ``start_response``, and which returns an ``app_iter`` iterable, among |
|
4342 |
other things. Previously, it was possible to return any object which had |
|
4343 |
the three WebOb ``app_iter``, ``headerlist``, and ``status`` attributes as |
|
4344 |
a response, so this is a backwards incompatibility. It is possible to get |
|
4345 |
backwards compatibility back by registering an adapter to IResponse from |
|
4346 |
the type of object you're now returning from view callables. See the |
|
4347 |
section in the Hooks chapter of the documentation entitled "Changing How |
|
4348 |
Pyramid Treats View Responses". |
|
4349 |
|
|
4350 |
- The ``pyramid.interfaces.IResponse`` interface is now much more extensive. |
|
4351 |
Previously it defined only ``app_iter``, ``status`` and ``headerlist``; now |
|
4352 |
it is basically intended to directly mirror the ``webob.Response`` API, |
|
4353 |
which has many methods and attributes. |
|
4354 |
|
|
4355 |
- The ``pyramid.httpexceptions`` classes named ``HTTPFound``, |
|
4356 |
``HTTPMultipleChoices``, ``HTTPMovedPermanently``, ``HTTPSeeOther``, |
|
4357 |
``HTTPUseProxy``, and ``HTTPTemporaryRedirect`` now accept ``location`` as |
|
4358 |
their first positional argument rather than ``detail``. This means that |
|
4359 |
you can do, e.g. ``return pyramid.httpexceptions.HTTPFound('http://foo')`` |
|
4360 |
rather than ``return |
|
4361 |
pyramid.httpexceptions.HTTPFound(location='http//foo')`` (the latter will |
|
4362 |
of course continue to work). |
|
4363 |
|
|
4364 |
Dependencies |
|
4365 |
------------ |
|
4366 |
|
|
4367 |
- Pyramid now depends on WebOb >= 1.0.2 as tests depend on the bugfix in that |
|
4368 |
release: "Fix handling of WSGI environs with missing ``SCRIPT_NAME``". |
|
4369 |
(Note that in reality, everyone should probably be using 1.0.4 or better |
|
4370 |
though, as WebOb 1.0.2 and 1.0.3 were effectively brownbag releases.) |
|
4371 |
|
e21ed8
|
4372 |
1.0 (2011-01-30) |
CM |
4373 |
================ |
|
4374 |
|
|
4375 |
Documentation |
|
4376 |
------------- |
|
4377 |
|
|
4378 |
- Fixed bug in ZODB Wiki tutorial (missing dependency on ``docutils`` in |
|
4379 |
"models" step within ``setup.py``). |
|
4380 |
|
|
4381 |
- Removed API documentation for ``pyramid.testing`` APIs named |
|
4382 |
``registerDummySecurityPolicy``, ``registerResources``, ``registerModels``, |
|
4383 |
``registerEventListener``, ``registerTemplateRenderer``, |
|
4384 |
``registerDummyRenderer``, ``registerView``, ``registerUtility``, |
|
4385 |
``registerAdapter``, ``registerSubscriber``, ``registerRoute``, |
|
4386 |
and ``registerSettings``. |
|
4387 |
|
|
4388 |
- Moved "Using ZODB With ZEO" and "Using repoze.catalog Within Pyramid" |
|
4389 |
tutorials out of core documentation and into the Pyramid Tutorials site |
cd8ac8
|
4390 |
(http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/). |
e21ed8
|
4391 |
|
CM |
4392 |
- Changed "Cleaning up After a Request" section in the URL Dispatch chapter |
|
4393 |
to use ``request.add_finished_callback`` instead of jamming an object with |
|
4394 |
a ``__del__`` into the WSGI environment. |
|
4395 |
|
|
4396 |
- Remove duplication of ``add_route`` API documentation from URL Dispatch |
|
4397 |
narrative chapter. |
|
4398 |
|
|
4399 |
- Remove duplication of API and narrative documentation in |
|
4400 |
``pyramid.view.view_config`` API docs by pointing to |
|
4401 |
``pyramid.config.add_view`` documentation and narrative chapter |
|
4402 |
documentation. |
|
4403 |
|
|
4404 |
- Removed some API documentation duplicated in narrative portions of |
|
4405 |
documentation |
|
4406 |
|
|
4407 |
- Removed "Overall Flow of Authentication" from SQLAlchemy + URL Dispatch |
|
4408 |
wiki tutorial due to print space concerns (moved to Pyramid Tutorials |
|
4409 |
site). |
|
4410 |
|
|
4411 |
Bug Fixes |
|
4412 |
--------- |
|
4413 |
|
|
4414 |
- Deprecated-since-BFG-1.2 APIs from ``pyramid.testing`` now properly emit |
|
4415 |
deprecation warnings. |
|
4416 |
|
|
4417 |
- Added ``egg:repoze.retry#retry`` middleware to the WSGI pipeline in ZODB |
|
4418 |
templates (retry ZODB conflict errors which occur in normal operations). |
|
4419 |
|
|
4420 |
- Removed duplicate implementations of ``is_response``. Two competing |
|
4421 |
implementations existed: one in ``pyramid.config`` and one in |
|
4422 |
``pyramid.view``. Now the one defined in ``pyramid.view`` is used |
|
4423 |
internally by ``pyramid.config`` and continues to be advertised as an API. |
|
4424 |
|
|
4425 |
1.0b3 (2011-01-28) |
|
4426 |
================== |
|
4427 |
|
|
4428 |
Bug Fixes |
|
4429 |
--------- |
|
4430 |
|
|
4431 |
- Use © instead of copyright symbol in paster templates / tutorial |
|
4432 |
templates for the benefit of folks who cutnpaste and save to a non-UTF8 |
|
4433 |
format. |
|
4434 |
|
|
4435 |
- ``pyramid.view.append_slash_notfound_view`` now preserves GET query |
|
4436 |
parameters across redirects. |
|
4437 |
|
|
4438 |
Documentation |
|
4439 |
------------- |
|
4440 |
|
|
4441 |
- Beef up documentation related to ``set_default_permission``: explicitly |
|
4442 |
mention that default permissions also protect exception views. |
|
4443 |
|
|
4444 |
- Paster templates and tutorials now use spaces instead of tabs in their HTML |
|
4445 |
templates. |
|
4446 |
|
|
4447 |
1.0b2 (2011-01-24) |
|
4448 |
================== |
|
4449 |
|
|
4450 |
Bug Fixes |
|
4451 |
--------- |
|
4452 |
|
|
4453 |
- The ``production.ini`` generated by all paster templates now have an |
|
4454 |
effective logging level of WARN, which prevents e.g. SQLAlchemy statement |
|
4455 |
logging and other inappropriate output. |
|
4456 |
|
|
4457 |
- The ``production.ini`` of the ``pyramid_routesalchemy`` and |
|
4458 |
``pyramid_alchemy`` paster templates did not have a ``sqlalchemy`` logger |
|
4459 |
section, preventing ``paster serve production.ini`` from working. |
|
4460 |
|
|
4461 |
- The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` paster templates used |
|
4462 |
the ``{{package}}`` variable in a place where it should have used the |
|
4463 |
``{{project}}`` variable, causing applications created with uppercase |
|
4464 |
letters e.g. ``paster create -t pyramid_routesalchemy Dibbus`` to fail to |
|
4465 |
start when ``paster serve development.ini`` was used against the result. |
|
4466 |
See https://github.com/Pylons/pyramid/issues/#issue/107 |
|
4467 |
|
|
4468 |
- The ``render_view`` method of ``pyramid.renderers.RendererHelper`` passed |
|
4469 |
an incorrect value into the renderer for ``renderer_info``. It now passes |
|
4470 |
an instance of ``RendererHelper`` instead of a dictionary, which is |
|
4471 |
consistent with other usages. See |
|
4472 |
https://github.com/Pylons/pyramid/issues#issue/106 |
|
4473 |
|
|
4474 |
- A bug existed in the ``pyramid.authentication.AuthTktCookieHelper`` which |
|
4475 |
would break any usage of an AuthTktAuthenticationPolicy when one was |
|
4476 |
configured to reissue its tokens (``reissue_time`` < ``timeout`` / |
|
4477 |
``max_age``). Symptom: ``ValueError: ('Invalid token %r', '')``. See |
|
4478 |
https://github.com/Pylons/pyramid/issues#issue/108. |
|
4479 |
|
|
4480 |
1.0b1 (2011-01-21) |
|
4481 |
================== |
|
4482 |
|
|
4483 |
Features |
|
4484 |
-------- |
|
4485 |
|
|
4486 |
- The AuthTktAuthenticationPolicy now accepts a ``tokens`` parameter via |
|
4487 |
``pyramid.security.remember``. The value must be a sequence of strings. |
|
4488 |
Tokens are placed into the auth_tkt "tokens" field and returned in the |
|
4489 |
auth_tkt cookie. |
|
4490 |
|
|
4491 |
- Add ``wild_domain`` argument to AuthTktAuthenticationPolicy, which defaults |
|
4492 |
to ``True``. If it is set to ``False``, the feature of the policy which |
b4cd53
|
4493 |
sets a cookie with a wildcard domain will be turned off. |
e21ed8
|
4494 |
|
CM |
4495 |
- Add a ``MANIFEST.in`` file to each paster template. See |
|
4496 |
https://github.com/Pylons/pyramid/issues#issue/95 |
|
4497 |
|
|
4498 |
Bug Fixes |
|
4499 |
--------- |
|
4500 |
|
|
4501 |
- ``testing.setUp`` now adds a ``settings`` attribute to the registry (both |
|
4502 |
when it's passed a registry without any settings and when it creates one). |
|
4503 |
|
|
4504 |
- The ``testing.setUp`` function now takes a ``settings`` argument, which |
|
4505 |
should be a dictionary. Its values will subsequently be available on the |
|
4506 |
returned ``config`` object as ``config.registry.settings``. |
|
4507 |
|
|
4508 |
Documentation |
|
4509 |
------------- |
|
4510 |
|
|
4511 |
- Added "What's New in Pyramid 1.0" chapter to HTML rendering of |
|
4512 |
documentation. |
|
4513 |
|
|
4514 |
- Merged caseman-master narrative editing branch, many wording fixes and |
|
4515 |
extensions. |
|
4516 |
|
|
4517 |
- Fix deprecated example showing ``chameleon_zpt`` API call in testing |
|
4518 |
narrative chapter. |
|
4519 |
|
|
4520 |
- Added "Adding Methods to the Configurator via ``add_directive``" section to |
|
4521 |
Advanced Configuration narrative chapter. |
|
4522 |
|
|
4523 |
- Add docs for ``add_finished_callback``, ``add_response_callback``, |
|
4524 |
``route_path``, ``route_url``, and ``static_url`` methods to |
|
4525 |
``pyramid.request.Request`` API docs. |
|
4526 |
|
|
4527 |
- Add (minimal) documentation about using I18N within Mako templates to |
|
4528 |
"Internationalization and Localization" narrative chapter. |
|
4529 |
|
|
4530 |
- Move content of "Forms" chapter back to "Views" chapter; I can't think of a |
|
4531 |
better place to put it. |
|
4532 |
|
|
4533 |
- Slightly improved interface docs for ``IAuthorizationPolicy``. |
|
4534 |
|
|
4535 |
- Minimally explain usage of custom regular expressions in URL dispatch |
|
4536 |
replacement markers within URL Dispatch chapter. |
|
4537 |
|
|
4538 |
Deprecations |
|
4539 |
------------- |
|
4540 |
|
|
4541 |
- Using the ``pyramid.view.bfg_view`` alias for ``pyramid.view.view_config`` |
|
4542 |
(a backwards compatibility shim) now issues a deprecation warning. |
|
4543 |
|
|
4544 |
Backwards Incompatibilities |
|
4545 |
--------------------------- |
|
4546 |
|
|
4547 |
- Using ``testing.setUp`` now registers an ISettings utility as a side |
|
4548 |
effect. Some test code which queries for this utility after |
|
4549 |
``testing.setUp`` via queryAdapter will expect a return value of ``None``. |
|
4550 |
This code will need to be changed. |
|
4551 |
|
|
4552 |
- When a ``pyramid.exceptions.Forbidden`` error is raised, its status code |
|
4553 |
now ``403 Forbidden``. It was previously ``401 Unauthorized``, for |
|
4554 |
backwards compatibility purposes with ``repoze.bfg``. This change will |
|
4555 |
cause problems for users of Pyramid with ``repoze.who``, which intercepts |
|
4556 |
``401 Unauthorized`` by default, but allows ``403 Forbidden`` to pass |
|
4557 |
through. Those deployments will need to configure ``repoze.who`` to also |
|
4558 |
react to ``403 Forbidden``. |
|
4559 |
|
|
4560 |
- The default value for the ``cookie_on_exception`` parameter to |
|
4561 |
``pyramid.session.UnencyrptedCookieSessionFactory`` is now ``True``. This |
|
4562 |
means that when view code causes an exception to be raised, and the session |
|
4563 |
has been mutated, a cookie will be sent back in the response. Previously |
|
4564 |
its default value was ``False``. |
|
4565 |
|
|
4566 |
Paster Templates |
|
4567 |
---------------- |
|
4568 |
|
|
4569 |
- The ``pyramid_zodb``, ``pyramid_routesalchemy`` and ``pyramid_alchemy`` |
|
4570 |
paster templates now use a default "commit veto" hook when configuring the |
|
4571 |
``repoze.tm2`` transaction manager in ``development.ini``. This prevents a |
|
4572 |
transaction from being committed when the response status code is within |
|
4573 |
the 400 or 500 ranges. See also |
|
4574 |
http://docs.repoze.org/tm2/#using-a-commit-veto. |
|
4575 |
|
|
4576 |
1.0a10 (2011-01-18) |
|
4577 |
=================== |
|
4578 |
|
|
4579 |
Bug Fixes |
|
4580 |
--------- |
|
4581 |
|
|
4582 |
- URL dispatch now properly handles a ``.*`` or ``*`` appearing in a regex |
|
4583 |
match when used inside brackets. Resolves issue #90. |
|
4584 |
|
|
4585 |
Backwards Incompatibilities |
|
4586 |
--------------------------- |
|
4587 |
|
|
4588 |
- The ``add_handler`` method of a Configurator has been removed from the |
|
4589 |
Pyramid core. Handlers are now a feature of the ``pyramid_handlers`` |
|
4590 |
package, which can be downloaded from PyPI. Documentation for the package |
|
4591 |
should be available via |
cd8ac8
|
4592 |
http://docs.pylonsproject.org/projects/pyramid_handlers/en/latest/, |
TL |
4593 |
which describes how |
e21ed8
|
4594 |
to add a configuration statement to your ``main`` block to reobtain this |
CM |
4595 |
method. You will also need to add an ``install_requires`` dependency upon |
|
4596 |
``pyramid_handlers`` to your ``setup.py`` file. |
|
4597 |
|
|
4598 |
- The ``load_zcml`` method of a Configurator has been removed from the |
|
4599 |
Pyramid core. Loading ZCML is now a feature of the ``pyramid_zcml`` |
|
4600 |
package, which can be downloaded from PyPI. Documentation for the package |
|
4601 |
should be available via |
cd8ac8
|
4602 |
http://docs.pylonsproject.org/projects/pyramid_zcml/en/latest/, |
TL |
4603 |
which describes how |
e21ed8
|
4604 |
to add a configuration statement to your ``main`` block to reobtain this |
CM |
4605 |
method. You will also need to add an ``install_requires`` dependency upon |
|
4606 |
``pyramid_zcml`` to your ``setup.py`` file. |
|
4607 |
|
|
4608 |
- The ``pyramid.includes`` subpackage has been removed. ZCML files which use |
|
4609 |
include the package ``pyramid.includes`` (e.g. ``<include |
|
4610 |
package="pyramid.includes"/>``) now must include the ``pyramid_zcml`` |
|
4611 |
package instead (e.g. ``<include package="pyramid_zcml"/>``). |
|
4612 |
|
|
4613 |
- The ``pyramid.view.action`` decorator has been removed from the Pyramid |
|
4614 |
core. Handlers are now a feature of the ``pyramid_handlers`` package. It |
|
4615 |
should now be imported from ``pyramid_handlers`` e.g. ``from |
|
4616 |
pyramid_handlers import action``. |
|
4617 |
|
|
4618 |
- The ``handler`` ZCML directive has been removed. It is now a feature of |
|
4619 |
the ``pyramid_handlers`` package. |
|
4620 |
|
|
4621 |
- The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` paster |
|
4622 |
templates were removed. Use ``pyramid_sqla`` (available from PyPI) as a |
|
4623 |
generic replacement for Pylons-esque development. |
|
4624 |
|
|
4625 |
- The ``make_app`` function has been removed from the ``pyramid.router`` |
|
4626 |
module. It continues life within the ``pyramid_zcml`` package. This |
|
4627 |
leaves the ``pyramid.router`` module without any API functions. |
|
4628 |
|
|
4629 |
- The ``configure_zcml`` setting within the deployment settings (within |
|
4630 |
``**settings`` passed to a Pyramid ``main`` function) has ceased to have any |
|
4631 |
meaning. |
|
4632 |
|
|
4633 |
Features |
|
4634 |
-------- |
|
4635 |
|
|
4636 |
- ``pyramid.testing.setUp`` and ``pyramid.testing.tearDown`` have been |
|
4637 |
undeprecated. They are now the canonical setup and teardown APIs for test |
|
4638 |
configuration, replacing "direct" creation of a Configurator. This is a |
|
4639 |
change designed to provide a facade that will protect against any future |
|
4640 |
Configurator deprecations. |
|
4641 |
|
|
4642 |
- Add ``charset`` attribute to ``pyramid.testing.DummyRequest`` |
|
4643 |
(unconditionally ``UTF-8``). |
|
4644 |
|
|
4645 |
- Add ``add_directive`` method to configurator, which allows framework |
|
4646 |
extenders to add methods to the configurator (ala ZCML directives). |
|
4647 |
|
|
4648 |
- When ``Configurator.include`` is passed a *module* as an argument, it |
|
4649 |
defaults to attempting to find and use a callable named ``includeme`` |
|
4650 |
within that module. This makes it possible to use |
|
4651 |
``config.include('some.module')`` rather than |
|
4652 |
``config.include('some.module.somefunc')`` as long as the include function |
|
4653 |
within ``some.module`` is named ``includeme``. |
|
4654 |
|
|
4655 |
- The ``bfg2pyramid`` script now converts ZCML include tags that have |
|
4656 |
``repoze.bfg.includes`` as a package attribute to the value |
|
4657 |
``pyramid_zcml``. For example, ``<include package="repoze.bfg.includes">`` |
|
4658 |
will be converted to ``<include package="pyramid_zcml">``. |
|
4659 |
|
|
4660 |
Paster Templates |
|
4661 |
---------------- |
|
4662 |
|
|
4663 |
- All paster templates now use ``pyramid.testing.setUp`` and |
|
4664 |
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand" |
|
4665 |
within their ``tests.py`` module, as per decision in features above. |
|
4666 |
|
|
4667 |
- The ``starter_zcml`` paster template has been moved to the ``pyramid_zcml`` |
|
4668 |
package. |
|
4669 |
|
|
4670 |
Documentation |
|
4671 |
------------- |
|
4672 |
|
|
4673 |
- The wiki and wiki2 tutorials now use ``pyramid.testing.setUp`` and |
|
4674 |
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand", |
|
4675 |
as per decision in features above. |
|
4676 |
|
|
4677 |
- The "Testing" narrative chapter now explains ``pyramid.testing.setUp`` and |
|
4678 |
``pyramid.testing.tearDown`` instead of Configurator creation and |
|
4679 |
``Configurator.begin()`` and ``Configurator.end()``. |
|
4680 |
|
|
4681 |
- Document the ``request.override_renderer`` attribute within the narrative |
|
4682 |
"Renderers" chapter in a section named "Overriding A Renderer at Runtime". |
|
4683 |
|
|
4684 |
- The "Declarative Configuration" narrative chapter has been removed (it was |
|
4685 |
moved to the ``pyramid_zcml`` package). |
|
4686 |
|
|
4687 |
- Most references to ZCML in narrative chapters have been removed or |
|
4688 |
redirected to ``pyramid_zcml`` locations. |
|
4689 |
|
|
4690 |
Deprecations |
|
4691 |
------------ |
|
4692 |
|
|
4693 |
- Deprecation warnings related to import of the following API functions were |
|
4694 |
added: ``pyramid.traversal.find_model``, ``pyramid.traversal.model_path``, |
|
4695 |
``pyramid.traversal.model_path_tuple``, ``pyramid.url.model_url``. The |
|
4696 |
instructions emitted by the deprecation warnings instruct the developer to |
|
4697 |
change these method spellings to their ``resource`` equivalents. This is a |
|
4698 |
consequence of the mass concept rename of "model" to "resource" performed |
|
4699 |
in 1.0a7. |
|
4700 |
|
|
4701 |
1.0a9 (2011-01-08) |
|
4702 |
================== |
|
4703 |
|
|
4704 |
Bug Fixes |
|
4705 |
--------- |
|
4706 |
|
|
4707 |
- The ``proutes`` command tried too hard to resolve the view for printing, |
|
4708 |
resulting in exceptions when an exceptional root factory was encountered. |
|
4709 |
Instead of trying to resolve the view, if it cannot, it will now just print |
|
4710 |
``<unknown>``. |
|
4711 |
|
|
4712 |
- The `self` argument was included in new methods of the ``ISession`` interface |
|
4713 |
signature, causing ``pyramid_beaker`` tests to fail. |
|
4714 |
|
|
4715 |
- Readd ``pyramid.traversal.model_path_tuple`` as an alias for |
|
4716 |
``pyramid.traversal.resource_path_tuple`` for backwards compatibility. |
|
4717 |
|
|
4718 |
Features |
|
4719 |
-------- |
|
4720 |
|
|
4721 |
- Add a new API ``pyramid.url.current_route_url``, which computes a URL based |
|
4722 |
on the "current" route (if any) and its matchdict values. |
|
4723 |
|
|
4724 |
- ``config.add_view`` now accepts a ``decorator`` keyword argument, a callable |
|
4725 |
which will decorate the view callable before it is added to the registry. |
|
4726 |
|
|
4727 |
- If a handler class provides an ``__action_decorator__`` attribute (usually |
|
4728 |
a classmethod or staticmethod), use that as the decorator for each view |
|
4729 |
registration for that handler. |
|
4730 |
|
|
4731 |
- The ``pyramid.interfaces.IAuthenticationPolicy`` interface now specifies an |
|
4732 |
``unauthenticated_userid`` method. This method supports an important |
|
4733 |
optimization required by people who are using persistent storages which do |
|
4734 |
not support object caching and whom want to create a "user object" as a |
|
4735 |
request attribute. |
|
4736 |
|
|
4737 |
- A new API has been added to the ``pyramid.security`` module named |
|
4738 |
``unauthenticated_userid``. This API function calls the |
|
4739 |
``unauthenticated_userid`` method of the effective security policy. |
|
4740 |
|
|
4741 |
- An ``unauthenticated_userid`` method has been added to the dummy |
|
4742 |
authentication policy returned by |
|
4743 |
``pyramid.config.Configurator.testing_securitypolicy``. It returns the |
|
4744 |
same thing as that the dummy authentication policy's |
|
4745 |
``authenticated_userid`` method. |
|
4746 |
|
|
4747 |
- The class ``pyramid.authentication.AuthTktCookieHelper`` is now an API. |
|
4748 |
This class can be used by third-party authentication policy developers to |
|
4749 |
help in the mechanics of authentication cookie-setting. |
|
4750 |
|
|
4751 |
- New constructor argument to Configurator: ``default_view_mapper``. Useful |
|
4752 |
to create systems that have alternate view calling conventions. A view |
|
4753 |
mapper allows objects that are meant to be used as view callables to have |
|
4754 |
an arbitrary argument list and an arbitrary result. The object passed as |
|
4755 |
``default_view_mapper`` should implement the |
|
4756 |
``pyramid.interfaces.IViewMapperFactory`` interface. |
|
4757 |
|
|
4758 |
- add a ``set_view_mapper`` API to Configurator. Has |
|
4759 |
the same result as passing ``default_view_mapper`` to the Configurator |
|
4760 |
constructor. |
|
4761 |
|
|
4762 |
- ``config.add_view`` now accepts a ``mapper`` keyword argument, which should |
|
4763 |
either be ``None``, a string representing a Python dotted name, or an |
|
4764 |
object which is an ``IViewMapperFactory``. This feature is not useful for |
|
4765 |
"civilians", only for extension writers. |
|
4766 |
|
|
4767 |
- Allow static renderer provided during view registration to be overridden at |
|
4768 |
request time via a request attribute named ``override_renderer``, which |
|
4769 |
should be the name of a previously registered renderer. Useful to provide |
|
4770 |
"omnipresent" RPC using existing rendered views. |
|
4771 |
|
|
4772 |
- Instances of ``pyramid.testing.DummyRequest`` now have a ``session`` |
|
4773 |
object, which is mostly a dictionary, but also implements the other session |
|
4774 |
API methods for flash and CSRF. |
|
4775 |
|
|
4776 |
Backwards Incompatibilities |
|
4777 |
--------------------------- |
|
4778 |
|
|
4779 |
- Since the ``pyramid.interfaces.IAuthenticationPolicy`` interface now |
|
4780 |
specifies that a policy implementation must implement an |
|
4781 |
``unauthenticated_userid`` method, all third-party custom authentication |
|
4782 |
policies now must implement this method. It, however, will only be called |
|
4783 |
when the global function named ``pyramid.security.unauthenticated_userid`` |
|
4784 |
is invoked, so if you're not invoking that, you will not notice any issues. |
|
4785 |
|
|
4786 |
- ``pyramid.interfaces.ISession.get_csrf_token`` now mandates that an |
|
4787 |
implementation should return a *new* token if one doesn't already exist in |
|
4788 |
the session (previously it would return None). The internal sessioning |
|
4789 |
implementation has been changed. |
|
4790 |
|
|
4791 |
Documentation |
|
4792 |
------------- |
|
4793 |
|
|
4794 |
- The (weak) "Converting a CMF Application to Pyramid" tutorial has been |
|
4795 |
removed from the tutorials section. It was moved to the |
|
4796 |
``pyramid_tutorials`` Github repository. |
|
4797 |
|
|
4798 |
- The "Resource Location and View Lookup" chapter has been replaced with a |
|
4799 |
variant of Rob Miller's "Much Ado About Traversal" (originally published at |
|
4800 |
http://blog.nonsequitarian.org/2010/much-ado-about-traversal/). |
|
4801 |
|
|
4802 |
- Many minor wording tweaks and refactorings (merged Casey Duncan's docs |
|
4803 |
fork, in which he is working on general editing). |
|
4804 |
|
|
4805 |
- Added (weak) description of new view mapper feature to Hooks narrative |
|
4806 |
chapter. |
|
4807 |
|
|
4808 |
- Split views chapter into 2: View Callables and View Configuration. |
|
4809 |
|
|
4810 |
- Reorder Renderers and Templates chapters after View Callables but before |
|
4811 |
View Configuration. |
|
4812 |
|
|
4813 |
- Merge Session Objects, Cross-Site Request Forgery, and Flash Messaging |
|
4814 |
chapter into a single Sessions chapter. |
|
4815 |
|
|
4816 |
- The Wiki and Wiki2 tutorials now have much nicer CSS and graphics. |
|
4817 |
|
|
4818 |
Internals |
|
4819 |
--------- |
|
4820 |
|
|
4821 |
- The "view derivation" code is now factored into a set of classes rather |
|
4822 |
than a large number of standalone functions (a side effect of the |
|
4823 |
view mapper refactoring). |
|
4824 |
|
|
4825 |
- The ``pyramid.renderer.RendererHelper`` class has grown a ``render_view`` |
|
4826 |
method, which is used by the default view mapper (a side effect of the |
|
4827 |
view mapper refactoring). |
|
4828 |
|
|
4829 |
- The object passed as ``renderer`` to the "view deriver" is now an instance |
|
4830 |
of ``pyramid.renderers.RendererHelper`` rather than a dictionary (a side |
|
4831 |
effect of view mapper refactoring). |
|
4832 |
|
|
4833 |
- The class used as the "page template" in ``pyramid.chameleon_text`` was |
|
4834 |
removed, in preference to using a Chameleon-inbuilt version. |
|
4835 |
|
|
4836 |
- A view callable wrapper registered in the registry now contains an |
|
4837 |
``__original_view__`` attribute which references the original view callable |
|
4838 |
(or class). |
|
4839 |
|
|
4840 |
- The (non-API) method of all internal authentication policy implementations |
|
4841 |
previously named ``_get_userid`` is now named ``unauthenticated_userid``, |
|
4842 |
promoted to an API method. If you were overriding this method, you'll now |
|
4843 |
need to override it as ``unauthenticated_userid`` instead. |
|
4844 |
|
|
4845 |
- Remove (non-API) function of config.py named _map_view. |
|
4846 |
|
|
4847 |
1.0a8 (2010-12-27) |
|
4848 |
================== |
|
4849 |
|
|
4850 |
Bug Fixes |
|
4851 |
--------- |
|
4852 |
|
|
4853 |
- The name ``registry`` was not available in the ``paster pshell`` |
|
4854 |
environment under IPython. |
|
4855 |
|
|
4856 |
Features |
|
4857 |
-------- |
|
4858 |
|
|
4859 |
- If a resource implements a ``__resource_url__`` method, it will be called |
|
4860 |
as the result of invoking the ``pyramid.url.resource_url`` function to |
|
4861 |
generate a URL, overriding the default logic. See the new "Generating The |
|
4862 |
URL Of A Resource" section within the Resources narrative chapter. |
|
4863 |
|
|
4864 |
- Added flash messaging, as described in the "Flash Messaging" narrative |
|
4865 |
documentation chapter. |
|
4866 |
|
|
4867 |
- Added CSRF token generation, as described in the narrative chapter entitled |
|
4868 |
"Preventing Cross-Site Request Forgery Attacks". |
|
4869 |
|
|
4870 |
- Prevent misunderstanding of how the ``view`` and ``view_permission`` |
|
4871 |
arguments to add_route work by raising an exception during configuration if |
|
4872 |
view-related arguments exist but no ``view`` argument is passed. |
|
4873 |
|
|
4874 |
- Add ``paster proute`` command which displays a summary of the routing |
|
4875 |
table. See the narrative documentation section within the "URL Dispatch" |
|
4876 |
chapter entitled "Displaying All Application Routes". |
|
4877 |
|
|
4878 |
Paster Templates |
|
4879 |
---------------- |
|
4880 |
|
|
4881 |
- The ``pyramid_zodb`` Paster template no longer employs ZCML. Instead, it |
|
4882 |
is based on scanning. |
|
4883 |
|
|
4884 |
Documentation |
|
4885 |
------------- |
|
4886 |
|
|
4887 |
- Added "Generating The URL Of A Resource" section to the Resources narrative |
|
4888 |
chapter (includes information about overriding URL generation using |
|
4889 |
``__resource_url__``). |
|
4890 |
|
|
4891 |
- Added "Generating the Path To a Resource" section to the Resources |
|
4892 |
narrative chapter. |
|
4893 |
|
|
4894 |
- Added "Finding a Resource by Path" section to the Resources narrative |
|
4895 |
chapter. |
|
4896 |
|
|
4897 |
- Added "Obtaining the Lineage of a Resource" to the Resources narrative |
|
4898 |
chapter. |
|
4899 |
|
|
4900 |
- Added "Determining if a Resource is In The Lineage of Another Resource" to |
|
4901 |
Resources narrative chapter. |
|
4902 |
|
|
4903 |
- Added "Finding the Root Resource" to Resources narrative chapter. |
|
4904 |
|
|
4905 |
- Added "Finding a Resource With a Class or Interface in Lineage" to |
|
4906 |
Resources narrative chapter. |
|
4907 |
|
|
4908 |
- Added a "Flash Messaging" narrative documentation chapter. |
|
4909 |
|
|
4910 |
- Added a narrative chapter entitled "Preventing Cross-Site Request Forgery |
|
4911 |
Attacks". |
|
4912 |
|
|
4913 |
- Changed the "ZODB + Traversal Wiki Tutorial" based on changes to |
|
4914 |
``pyramid_zodb`` Paster template. |
|
4915 |
|
|
4916 |
- Added "Advanced Configuration" narrative chapter which documents how to |
|
4917 |
deal with configuration conflicts, two-phase configuration, ``include`` and |
|
4918 |
``commit``. |
|
4919 |
|
|
4920 |
- Fix API documentation rendering for ``pyramid.view.static`` |
|
4921 |
|
|
4922 |
- Add "Pyramid Provides More Than One Way to Do It" to Design Defense |
|
4923 |
documentation. |
|
4924 |
|
|
4925 |
- Changed "Static Assets" narrative chapter: clarify that ``name`` represents |
|
4926 |
a prefix unless it's a URL, added an example of a root-relative static view |
|
4927 |
fallback for URL dispatch, added an example of creating a simple view that |
|
4928 |
returns the body of a file. |
|
4929 |
|
|
4930 |
- Move ZCML usage in Hooks chapter to Declarative Configuration chapter. |
|
4931 |
|
|
4932 |
- Merge "Static Assets" chapter into the "Assets" chapter. |
|
4933 |
|
|
4934 |
- Added narrative documentation section within the "URL Dispatch" chapter |
|
4935 |
entitled "Displaying All Application Routes" (for ``paster proutes`` |
|
4936 |
command). |
|
4937 |
|
|
4938 |
1.0a7 (2010-12-20) |
|
4939 |
================== |
|
4940 |
|
|
4941 |
Terminology Changes |
|
4942 |
------------------- |
|
4943 |
|
|
4944 |
- The Pyramid concept previously known as "model" is now known as "resource". |
|
4945 |
As a result: |
|
4946 |
|
|
4947 |
- The following API changes have been made:: |
|
4948 |
|
|
4949 |
pyramid.url.model_url -> |
|
4950 |
pyramid.url.resource_url |
|
4951 |
|
|
4952 |
pyramid.traversal.find_model -> |
|
4953 |
pyramid.url.find_resource |
|
4954 |
|
|
4955 |
pyramid.traversal.model_path -> |
|
4956 |
pyramid.traversal.resource_path |
|
4957 |
|
|
4958 |
pyramid.traversal.model_path_tuple -> |
|
4959 |
pyramid.traversal.resource_path_tuple |
|
4960 |
|
|
4961 |
pyramid.traversal.ModelGraphTraverser -> |
|
4962 |
pyramid.traversal.ResourceTreeTraverser |
|
4963 |
|
|
4964 |
pyramid.config.Configurator.testing_models -> |
|
4965 |
pyramid.config.Configurator.testing_resources |
|
4966 |
|
|
4967 |
pyramid.testing.registerModels -> |
|
4968 |
pyramid.testing.registerResources |
|
4969 |
|
|
4970 |
pyramid.testing.DummyModel -> |
|
4971 |
pyramid.testing.DummyResource |
|
4972 |
|
|
4973 |
- All documentation which previously referred to "model" now refers to |
|
4974 |
"resource". |
|
4975 |
|
|
4976 |
- The ``starter`` and ``starter_zcml`` paster templates now have a |
|
4977 |
``resources.py`` module instead of a ``models.py`` module. |
|
4978 |
|
|
4979 |
- Positional argument names of various APIs have been changed from |
|
4980 |
``model`` to ``resource``. |
|
4981 |
|
|
4982 |
Backwards compatibility shims have been left in place in all cases. They |
|
4983 |
will continue to work "forever". |
|
4984 |
|
|
4985 |
- The Pyramid concept previously known as "resource" is now known as "asset". |
|
4986 |
As a result: |
|
4987 |
|
|
4988 |
- The (non-API) module previously known as ``pyramid.resource`` is now |
|
4989 |
known as ``pyramid.asset``. |
|
4990 |
|
|
4991 |
- All docs that previously referred to "resource specification" now refer |
|
4992 |
to "asset specification". |
|
4993 |
|
|
4994 |
- The following API changes were made:: |
|
4995 |
|
|
4996 |
pyramid.config.Configurator.absolute_resource_spec -> |
|
4997 |
pyramid.config.Configurator.absolute_asset_spec |
|
4998 |
|
|
4999 |
pyramid.config.Configurator.override_resource -> |
|
5000 |
pyramid.config.Configurator.override_asset |
|
5001 |
|
|
5002 |
- The ZCML directive previously known as ``resource`` is now known as |
|
5003 |
``asset``. |
|
5004 |
|
|
5005 |
- The setting previously known as ``BFG_RELOAD_RESOURCES`` (envvar) or |
|
5006 |
``reload_resources`` (config file) is now known, respectively, as |
|
5007 |
``PYRAMID_RELOAD_ASSETS`` and ``reload_assets``. |
|
5008 |
|
|
5009 |
Backwards compatibility shims have been left in place in all cases. They |
|
5010 |
will continue to work "forever". |
|
5011 |
|
|
5012 |
Bug Fixes |
|
5013 |
--------- |
|
5014 |
|
|
5015 |
- Make it possible to succesfully run all tests via ``nosetests`` command |
|
5016 |
directly (rather than indirectly via ``python setup.py nosetests``). |
|
5017 |
|
|
5018 |
- When a configuration conflict is encountered during scanning, the conflict |
|
5019 |
exception now shows the decorator information that caused the conflict. |
|
5020 |
|
|
5021 |
Features |
|
5022 |
-------- |
|
5023 |
|
|
5024 |
- Added ``debug_routematch`` configuration setting that logs matched routes |
|
5025 |
(including the matchdict and predicates). |
|
5026 |
|
|
5027 |
- The name ``registry`` is now available in a ``pshell`` environment by |
|
5028 |
default. It is the application registry object. |
|
5029 |
|
|
5030 |
Environment |
|
5031 |
----------- |
|
5032 |
|
|
5033 |
- All environment variables which used to be prefixed with ``BFG_`` are now |
|
5034 |
prefixed with ``PYRAMID_`` (e.g. ``BFG_DEBUG_NOTFOUND`` is now |
|
5035 |
``PYRAMID_DEBUG_NOTFOUND``) |
|
5036 |
|
|
5037 |
Documentation |
|
5038 |
------------- |
|
5039 |
|
|
5040 |
- Added "Debugging Route Matching" section to the urldispatch narrative |
|
5041 |
documentation chapter. |
|
5042 |
|
|
5043 |
- Added reference to ``PYRAMID_DEBUG_ROUTEMATCH`` envvar and ``debug_routematch`` |
|
5044 |
config file setting to the Environment narrative docs chapter. |
|
5045 |
|
|
5046 |
- Changed "Project" chapter slightly to expand on use of ``paster pshell``. |
|
5047 |
|
|
5048 |
- Direct Jython users to Mako rather than Jinja2 in "Install" narrative |
|
5049 |
chapter. |
|
5050 |
|
|
5051 |
- Many changes to support terminological renaming of "model" to "resource" |
|
5052 |
and "resource" to "asset". |
|
5053 |
|
|
5054 |
- Added an example of ``WebTest`` functional testing to the testing narrative |
|
5055 |
chapter. |
|
5056 |
|
|
5057 |
- Rearranged chapter ordering by popular demand (URL dispatch first, then |
|
5058 |
traversal). Put hybrid chapter after views chapter. |
|
5059 |
|
|
5060 |
- Split off "Renderers" as its own chapter from "Views" chapter in narrative |
|
5061 |
documentation. |
|
5062 |
|
|
5063 |
Paster Templates |
|
5064 |
---------------- |
|
5065 |
|
|
5066 |
- Added ``debug_routematch = false`` to all paster templates. |
|
5067 |
|
|
5068 |
Dependencies |
|
5069 |
------------ |
|
5070 |
|
|
5071 |
- Depend on Venusian >= 0.5 (for scanning conflict exception decoration). |
|
5072 |
|
|
5073 |
1.0a6 (2010-12-15) |
|
5074 |
================== |
|
5075 |
|
|
5076 |
Bug Fixes |
|
5077 |
--------- |
|
5078 |
|
|
5079 |
- 1.0a5 introduced a bug when ``pyramid.config.Configurator.scan`` was used |
|
5080 |
without a ``package`` argument (e.g. ``config.scan()`` as opposed to |
|
5081 |
``config.scan('packagename')``. The symptoms were: lots of deprecation |
|
5082 |
warnings printed to the console about imports of deprecated Pyramid |
|
5083 |
functions and classes and non-detection of view callables decorated with |
|
5084 |
``view_config`` decorators. This has been fixed. |
|
5085 |
|
|
5086 |
- Tests now pass on Windows (no bugs found, but a few tests in the test suite |
|
5087 |
assumed UNIX path segments in filenames). |
|
5088 |
|
|
5089 |
Documentation |
|
5090 |
------------- |
|
5091 |
|
|
5092 |
- If you followed it to-the-letter, the ZODB+Traversal Wiki tutorial would |
|
5093 |
instruct you to run a test which would fail because the view callable |
|
5094 |
generated by the ``pyramid_zodb`` tutorial used a one-arg view callable, |
|
5095 |
but the test in the sample code used a two-arg call. |
|
5096 |
|
|
5097 |
- Updated ZODB+Traversal tutorial setup.py of all steps to match what's |
|
5098 |
generated by ``pyramid_zodb``. |
|
5099 |
|
|
5100 |
- Fix reference to ``repoze.bfg.traversalwrapper`` in "Models" chapter (point |
|
5101 |
at ``pyramid_traversalwrapper`` instead). |
|
5102 |
|
|
5103 |
1.0a5 (2010-12-14) |
|
5104 |
================== |
|
5105 |
|
|
5106 |
Features |
|
5107 |
-------- |
|
5108 |
|
|
5109 |
- Add a ``handler`` ZCML directive. This directive does the same thing as |
|
5110 |
``pyramid.configuration.add_handler``. |
|
5111 |
|
|
5112 |
- A new module named ``pyramid.config`` was added. It subsumes the duties of |
|
5113 |
the older ``pyramid.configuration`` module. |
|
5114 |
|
|
5115 |
- The new ``pyramid.config.Configurator` class has API methods that the older |
|
5116 |
``pyramid.configuration.Configurator`` class did not: ``with_context`` (a |
|
5117 |
classmethod), ``include``, ``action``, and ``commit``. These methods exist |
|
5118 |
for imperative application extensibility purposes. |
|
5119 |
|
|
5120 |
- The ``pyramid.testing.setUp`` function now accepts an ``autocommit`` |
|
5121 |
keyword argument, which defaults to ``True``. If it is passed ``False``, |
|
5122 |
the Config object returned by ``setUp`` will be a non-autocommiting Config |
|
5123 |
object. |
|
5124 |
|
|
5125 |
- Add logging configuration to all paster templates. |
|
5126 |
|
|
5127 |
- ``pyramid_alchemy``, ``pyramid_routesalchemy``, and ``pylons_sqla`` paster |
|
5128 |
templates now use idiomatic SQLAlchemy configuration in their respective |
|
5129 |
``.ini`` files and Python code. |
|
5130 |
|
|
5131 |
- ``pyramid.testing.DummyRequest`` now has a class variable, |
|
5132 |
``query_string``, which defaults to the empty string. |
|
5133 |
|
|
5134 |
- Add support for json on GAE by catching NotImplementedError and importing |
|
5135 |
simplejson from django.utils. |
|
5136 |
|
|
5137 |
- The Mako renderer now accepts a resource specification for |
|
5138 |
``mako.module_directory``. |
|
5139 |
|
|
5140 |
- New boolean Mako settings variable ``mako.strict_undefined``. See `Mako |
|
5141 |
Context Variables |
|
5142 |
<http://www.makotemplates.org/docs/runtime.html#context-variables>`_ for |
|
5143 |
its meaning. |
|
5144 |
|
|
5145 |
Dependencies |
|
5146 |
------------ |
|
5147 |
|
|
5148 |
- Depend on Mako 0.3.6+ (we now require the ``strict_undefined`` feature). |
|
5149 |
|
|
5150 |
Bug Fixes |
|
5151 |
--------- |
|
5152 |
|
|
5153 |
- When creating a Configurator from within a ``paster pshell`` session, you |
|
5154 |
were required to pass a ``package`` argument although ``package`` is not |
|
5155 |
actually required. If you didn't pass ``package``, you would receive an |
|
5156 |
error something like ``KeyError: '__name__'`` emanating from the |
|
5157 |
``pyramid.path.caller_module`` function. This has now been fixed. |
|
5158 |
|
|
5159 |
- The ``pyramid_routesalchemy`` paster template's unit tests failed |
|
5160 |
(``AssertionError: 'SomeProject' != 'someproject'``). This is fixed. |
|
5161 |
|
|
5162 |
- Make default renderer work (renderer factory registered with no name, which |
|
5163 |
is active for every view unless the view names a specific renderer). |
|
5164 |
|
|
5165 |
- The Mako renderer did not properly turn the ``mako.imports``, |
|
5166 |
``mako.default_filters``, and ``mako.imports`` settings into lists. |
|
5167 |
|
|
5168 |
- The Mako renderer did not properly convert the ``mako.error_handler`` |
|
5169 |
setting from a dotted name to a callable. |
|
5170 |
|
|
5171 |
Documentation |
|
5172 |
------------- |
|
5173 |
|
|
5174 |
- Merged many wording, readability, and correctness changes to narrative |
|
5175 |
documentation chapters from https://github.com/caseman/pyramid (up to and |
|
5176 |
including "Models" narrative chapter). |
|
5177 |
|
|
5178 |
- "Sample Applications" section of docs changed to note existence of Cluegun, |
|
5179 |
Shootout and Virginia sample applications, ported from their repoze.bfg |
|
5180 |
origin packages. |
|
5181 |
|
|
5182 |
- SQLAlchemy+URLDispatch tutorial updated to integrate changes to |
|
5183 |
``pyramid_routesalchemy`` template. |
|
5184 |
|
|
5185 |
- Add ``pyramid.interfaces.ITemplateRenderer`` interface to Interfaces API |
|
5186 |
chapter (has ``implementation()`` method, required to be used when getting |
|
5187 |
at Chameleon macros). |
|
5188 |
|
|
5189 |
- Add a "Modifying Package Structure" section to the project narrative |
|
5190 |
documentation chapter (explain turning a module into a package). |
|
5191 |
|
|
5192 |
- Documentation was added for the new ``handler`` ZCML directive in the ZCML |
|
5193 |
section. |
|
5194 |
|
|
5195 |
Deprecations |
|
5196 |
------------ |
|
5197 |
|
|
5198 |
- ``pyramid.configuration.Configurator`` is now deprecated. Use |
|
5199 |
``pyramid.config.Configurator``, passing its constructor |
|
5200 |
``autocommit=True`` instead. The ``pyramid.configuration.Configurator`` |
|
5201 |
alias will live for a long time, as every application uses it, but its |
|
5202 |
import now issues a deprecation warning. The |
|
5203 |
``pyramid.config.Configurator`` class has the same API as |
|
5204 |
``pyramid.configuration.Configurator`` class, which it means to replace, |
|
5205 |
except by default it is a *non-autocommitting* configurator. The |
|
5206 |
now-deprecated ``pyramid.configuration.Configurator`` will autocommit every |
|
5207 |
time a configuration method is called. |
|
5208 |
|
|
5209 |
The ``pyramid.configuration`` module remains, but it is deprecated. Use |
|
5210 |
``pyramid.config`` instead. |
|
5211 |
|
|
5212 |
1.0a4 (2010-11-21) |
|
5213 |
================== |
|
5214 |
|
|
5215 |
Features |
|
5216 |
-------- |
|
5217 |
|
|
5218 |
- URL Dispatch now allows for replacement markers to be located anywhere |
|
5219 |
in the pattern, instead of immediately following a ``/``. |
|
5220 |
|
|
5221 |
- URL Dispatch now uses the form ``{marker}`` to denote a replace marker in |
|
5222 |
the route pattern instead of ``:marker``. The old colon-style marker syntax |
|
5223 |
is still accepted for backwards compatibility. The new format allows a |
|
5224 |
regular expression for that marker location to be used instead of the |
|
5225 |
default ``[^/]+``, for example ``{marker:\d+}`` is now valid to require the |
|
5226 |
marker to be digits. |
|
5227 |
|
|
5228 |
- Add a ``pyramid.url.route_path`` API, allowing folks to generate relative |
|
5229 |
URLs. Calling ``route_path`` is the same as calling |
|
5230 |
``pyramid.url.route_url`` with the argument ``_app_url`` equal to the empty |
|
5231 |
string. |
|
5232 |
|
|
5233 |
- Add a ``pyramid.request.Request.route_path`` API. This is a convenience |
|
5234 |
method of the request which calls ``pyramid.url.route_url``. |
|
5235 |
|
|
5236 |
- Make test suite pass on Jython (requires PasteScript trunk, presumably to |
|
5237 |
be 1.7.4). |
|
5238 |
|
|
5239 |
- Make test suite pass on PyPy (Chameleon doesn't work). |
|
5240 |
|
|
5241 |
- Surrounding application configuration with ``config.begin()`` and |
|
5242 |
``config.end()`` is no longer necessary. All paster templates have been |
|
5243 |
changed to no longer call these functions. |
|
5244 |
|
|
5245 |
- Fix configurator to not convert ``ImportError`` to ``ConfigurationError`` |
|
5246 |
if the import that failed was unrelated to the import requested via a |
|
5247 |
dotted name when resolving dotted names (such as view dotted names). |
|
5248 |
|
|
5249 |
Documentation |
|
5250 |
------------- |
|
5251 |
|
|
5252 |
- SQLAlchemy+URLDispatch and ZODB+Traversal tutorials have been updated to |
|
5253 |
not call ``config.begin()`` or ``config.end()``. |
|
5254 |
|
|
5255 |
Bug Fixes |
|
5256 |
--------- |
|
5257 |
|
|
5258 |
- Add deprecation warnings to import of ``pyramid.chameleon_text`` and |
|
5259 |
``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``, |
|
5260 |
``render_template``, and ``render_template_to_response``. |
|
5261 |
|
|
5262 |
- Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and |
|
5263 |
``pyramid.zcml.file_configure``. |
|
5264 |
|
|
5265 |
- The ``pyramid_alchemy`` paster template had a typo, preventing an import |
|
5266 |
from working. |
|
5267 |
|
|
5268 |
- Fix apparent failures when calling ``pyramid.traversal.find_model(root, |
|
5269 |
path)`` or ``pyramid.traversal.traverse(path)`` when ``path`` is |
|
5270 |
(erroneously) a Unicode object. The user is meant to pass these APIs a |
|
5271 |
string object, never a Unicode object. In practice, however, users indeed |
|
5272 |
pass Unicode. Because the string that is passed must be ASCII encodeable, |
|
5273 |
now, if they pass a Unicode object, its data is eagerly converted to an |
|
5274 |
ASCII string rather than being passed along to downstream code as a |
|
5275 |
convenience to the user and to prevent puzzling second-order failures from |
|
5276 |
cropping up (all failures will occur within ``pyramid.traversal.traverse`` |
|
5277 |
rather than later down the line as the result of calling e.g. |
|
5278 |
``traversal_path``). |
|
5279 |
|
|
5280 |
Backwards Incompatibilities |
|
5281 |
--------------------------- |
|
5282 |
|
|
5283 |
- The ``pyramid.testing.zcml_configure`` API has been removed. It had been |
|
5284 |
advertised as removed since repoze.bfg 1.2a1, but hadn't actually been. |
|
5285 |
|
|
5286 |
Deprecations |
|
5287 |
------------ |
|
5288 |
|
|
5289 |
- The ``pyramid.settings.get_settings`` API is now deprecated. Use |
|
5290 |
``pyramid.threadlocals.get_current_registry().settings`` instead or use the |
|
5291 |
``settings`` attribute of the registry available from the request |
|
5292 |
(``request.registry.settings``). |
|
5293 |
|
|
5294 |
Documentation |
|
5295 |
------------- |
|
5296 |
|
|
5297 |
- Removed ``zodbsessions`` tutorial chapter. It's still useful, but we now |
|
5298 |
have a SessionFactory abstraction which competes with it, and maintaining |
|
5299 |
documentation on both ways to do it is a distraction. |
|
5300 |
|
|
5301 |
Internal |
|
5302 |
-------- |
|
5303 |
|
|
5304 |
- Replace Twill with WebTest in internal integration tests (avoid deprecation |
|
5305 |
warnings generated by Twill). |
|
5306 |
|
|
5307 |
1.0a3 (2010-11-16) |
|
5308 |
================== |
|
5309 |
|
|
5310 |
Features |
|
5311 |
-------- |
|
5312 |
|
|
5313 |
- Added Mako TemplateLookup settings for ``mako.error_handler``, |
|
5314 |
``mako.default_filters``, and ``mako.imports``. |
|
5315 |
|
|
5316 |
- Normalized all paster templates: each now uses the name ``main`` to |
|
5317 |
represent the function that returns a WSGI application, each now uses |
|
5318 |
WebError, each now has roughly the same shape of development.ini style. |
|
5319 |
|
|
5320 |
- Added class vars ``matchdict`` and ``matched_route`` to |
|
5321 |
``pyramid.request.Request``. Each is set to ``None``. |
|
5322 |
|
|
5323 |
- New API method: ``pyramid.settings.asbool``. |
|
5324 |
|
|
5325 |
- New API methods for ``pyramid.request.Request``: ``model_url``, |
|
5326 |
``route_url``, and ``static_url``. These are simple passthroughs for their |
|
5327 |
respective functions in ``pyramid.url``. |
|
5328 |
|
|
5329 |
- The ``settings`` object which used to be available only when |
|
5330 |
``request.settings.get_settings`` was called is now available as |
|
5331 |
``registry.settings`` (e.g. ``request.registry.settings`` in view code). |
|
5332 |
|
|
5333 |
Bug Fixes |
|
5334 |
--------- |
|
5335 |
|
|
5336 |
- The pylons_* paster templates erroneously used the ``{squiggly}`` routing |
|
5337 |
syntax as the pattern supplied to ``add_route``. This style of routing is |
|
5338 |
not supported. They were replaced with ``:colon`` style route patterns. |
|
5339 |
|
|
5340 |
- The pylons_* paster template used the same string |
|
5341 |
(``your_app_secret_string``) for the ``session.secret`` setting in the |
|
5342 |
generated ``development.ini``. This was a security risk if left unchanged |
|
5343 |
in a project that used one of the templates to produce production |
|
5344 |
applications. It now uses a randomly generated string. |
|
5345 |
|
|
5346 |
Documentation |
|
5347 |
------------- |
|
5348 |
|
|
5349 |
- ZODB+traversal wiki (``wiki``) tutorial updated due to changes to |
|
5350 |
``pyramid_zodb`` paster template. |
|
5351 |
|
|
5352 |
- SQLAlchemy+urldispach wiki (``wiki2``) tutorial updated due to changes to |
|
5353 |
``pyramid_routesalchemy`` paster template. |
|
5354 |
|
|
5355 |
- Documented the ``matchdict`` and ``matched_route`` attributes of the |
|
5356 |
request object in the Request API documentation. |
|
5357 |
|
|
5358 |
Deprecations |
|
5359 |
------------ |
|
5360 |
|
|
5361 |
- Obtaining the ``settings`` object via |
|
5362 |
``registry.{get|query}Utility(ISettings)`` is now deprecated. Instead, |
|
5363 |
obtain the ``settings`` object via the ``registry.settings`` attribute. A |
|
5364 |
backwards compatibility shim was added to the registry object to register |
|
5365 |
the settings object as an ISettings utility when ``setattr(registry, |
|
5366 |
'settings', foo)`` is called, but it will be removed in a later release. |
|
5367 |
|
|
5368 |
- Obtaining the ``settings`` object via ``pyramid.settings.get_settings`` is |
|
5369 |
now deprecated. Obtain it as the ``settings`` attribute of the registry |
|
5370 |
now (obtain the registry via ``pyramid.threadlocal.get_registry`` or as |
|
5371 |
``request.registry``). |
|
5372 |
|
|
5373 |
Behavior Differences |
|
5374 |
-------------------- |
|
5375 |
|
|
5376 |
- Internal: ZCML directives no longer call get_current_registry() if there's |
|
5377 |
a ``registry`` attribute on the ZCML context (kill off use of |
|
5378 |
threadlocals). |
|
5379 |
|
|
5380 |
- Internal: Chameleon template renderers now accept two arguments: ``path`` |
|
5381 |
and ``lookup``. ``Lookup`` will be an instance of a lookup class which |
|
5382 |
supplies (late-bound) arguments for debug, reload, and translate. Any |
|
5383 |
third-party renderers which use (the non-API) function |
|
5384 |
``pyramid.renderers.template_renderer_factory`` will need to adjust their |
|
5385 |
implementations to obey the new callback argument list. This change was to |
|
5386 |
kill off inappropriate use of threadlocals. |
|
5387 |
|
|
5388 |
1.0a2 (2010-11-09) |
|
5389 |
================== |
|
5390 |
|
|
5391 |
Documentation |
|
5392 |
------------- |
|
5393 |
|
|
5394 |
- All references to events by interface |
|
5395 |
(e.g. ``pyramid.interfaces.INewRequest``) have been changed to reference |
|
5396 |
their concrete classes (e.g. ``pyramid.events.NewRequest``) in |
|
5397 |
documentation about making subscriptions. |
|
5398 |
|
|
5399 |
- All references to Pyramid-the-application were changed from mod-`pyramid` |
|
5400 |
to app-`Pyramid`. A custom role setting was added to ``docs/conf.py`` to |
|
5401 |
allow for this. (internal) |
|
5402 |
|
|
5403 |
1.0a1 (2010-11-05) |
|
5404 |
================== |
|
5405 |
|
|
5406 |
Features (delta from BFG 1.3) |
|
5407 |
------------------------------- |
|
5408 |
|
|
5409 |
- Mako templating renderer supports resource specification format for |
|
5410 |
template lookups and within Mako templates. Absolute filenames must |
|
5411 |
be used in Pyramid to avoid this lookup process. |
|
5412 |
|
|
5413 |
- Add ``pyramid.httpexceptions`` module, which is a facade for the |
|
5414 |
``webob.exc`` module. |
|
5415 |
|
|
5416 |
- Direct built-in support for the Mako templating language. |
|
5417 |
|
|
5418 |
- A new configurator method exists: ``add_handler``. This method adds |
|
5419 |
a Pylons-style "view handler" (such a thing used to be called a |
|
5420 |
"controller" in Pylons 1.0). |
|
5421 |
|
|
5422 |
- New argument to configurator: ``session_factory``. |
|
5423 |
|
|
5424 |
- New method on configurator: ``set_session_factory`` |
|
5425 |
|
|
5426 |
- Using ``request.session`` now returns a (dictionary-like) session |
|
5427 |
object if a session factory has been configured. |
|
5428 |
|
|
5429 |
- The request now has a new attribute: ``tmpl_context`` for benefit of |
|
5430 |
Pylons users. |
|
5431 |
|
|
5432 |
- The decorator previously known as ``pyramid.view.bfg_view`` is now |
|
5433 |
known most formally as ``pyramid.view.view_config`` in docs and |
|
5434 |
paster templates. An import of ``pyramid.view.bfg_view``, however, |
|
5435 |
will continue to work "forever". |
|
5436 |
|
|
5437 |
- New API methods in ``pyramid.session``: ``signed_serialize`` and |
|
5438 |
``signed_deserialize``. |
|
5439 |
|
|
5440 |
- New interface: ``pyramid.interfaces.IRendererInfo``. An object of this type |
|
5441 |
is passed to renderer factory constructors (see "Backwards |
|
5442 |
Incompatibilities"). |
|
5443 |
|
|
5444 |
- New event type: ``pyramid.interfaces.IBeforeRender``. An object of this type |
|
5445 |
is sent as an event before a renderer is invoked (but after the |
|
5446 |
application-level renderer globals factory added via |
|
5447 |
``pyramid.configurator.configuration.set_renderer_globals_factory``, if any, |
|
5448 |
has injected its own keys). Applications may now subscribe to the |
|
5449 |
``IBeforeRender`` event type in order to introspect the and modify the set of |
|
5450 |
renderer globals before they are passed to a renderer. The event object |
|
5451 |
iself has a dictionary-like interface that can be used for this purpose. For |
|
5452 |
example:: |
|
5453 |
|
|
5454 |
from repoze.events import subscriber |
|
5455 |
from pyramid.interfaces import IRendererGlobalsEvent |
|
5456 |
|
|
5457 |
@subscriber(IRendererGlobalsEvent) |
|
5458 |
def add_global(event): |
|
5459 |
event['mykey'] = 'foo' |
|
5460 |
|
|
5461 |
If a subscriber attempts to add a key that already exist in the renderer |
|
5462 |
globals dictionary, a ``KeyError`` is raised. This limitation is due to the |
|
5463 |
fact that subscribers cannot be ordered relative to each other. The set of |
|
5464 |
keys added to the renderer globals dictionary by all subscribers and |
|
5465 |
app-level globals factories must be unique. |
|
5466 |
|
|
5467 |
- New class: ``pyramid.response.Response``. This is a pure facade for |
|
5468 |
``webob.Response`` (old code need not change to use this facade, it's |
|
5469 |
existence is mostly for vanity and documentation-generation purposes). |
|
5470 |
|
|
5471 |
- All preexisting paster templates (except ``zodb``) now use "imperative" |
|
5472 |
configuration (``starter``, ``routesalchemy``, ``alchemy``). |
|
5473 |
|
|
5474 |
- A new paster template named ``pyramid_starter_zcml`` exists, which uses |
|
5475 |
declarative configuration. |
|
5476 |
|
|
5477 |
Documentation (delta from BFG 1.3) |
|
5478 |
----------------------------------- |
|
5479 |
|
|
5480 |
- Added a ``pyramid.httpexceptions`` API documentation chapter. |
|
5481 |
|
|
5482 |
- Added a ``pyramid.session`` API documentation chapter. |
|
5483 |
|
|
5484 |
- Added a ``Session Objects`` narrative documentation chapter. |
|
5485 |
|
|
5486 |
- Added an API chapter for the ``pyramid.personality`` module. |
|
5487 |
|
|
5488 |
- Added an API chapter for the ``pyramid.response`` module. |
|
5489 |
|
|
5490 |
- All documentation which previously referred to ``webob.Response`` now uses |
|
5491 |
``pyramid.response.Response`` instead. |
|
5492 |
|
|
5493 |
- The documentation has been overhauled to use imperative configuration, |
|
5494 |
moving declarative configuration (ZCML) explanations to a separate |
|
5495 |
narrative chapter ``declarative.rst``. |
|
5496 |
|
|
5497 |
- The ZODB Wiki tutorial was updated to take into account changes to the |
|
5498 |
``pyramid_zodb`` paster template. |
|
5499 |
|
|
5500 |
- The SQL Wiki tutorial was updated to take into account changes to the |
|
5501 |
``pyramid_routesalchemy`` paster template. |
|
5502 |
|
|
5503 |
Backwards Incompatibilities (with BFG 1.3) |
|
5504 |
------------------------------------------ |
|
5505 |
|
|
5506 |
- There is no longer an ``IDebugLogger`` registered as a named utility |
|
5507 |
with the name ``repoze.bfg.debug``. |
|
5508 |
|
|
5509 |
- The logger which used to have the name of ``repoze.bfg.debug`` now |
|
5510 |
has the name ``pyramid.debug``. |
|
5511 |
|
|
5512 |
- The deprecated API ``pyramid.testing.registerViewPermission`` |
|
5513 |
has been removed. |
|
5514 |
|
|
5515 |
- The deprecated API named ``pyramid.testing.registerRoutesMapper`` |
|
5516 |
has been removed. |
|
5517 |
|
|
5518 |
- The deprecated API named ``pyramid.request.get_request`` was removed. |
|
5519 |
|
|
5520 |
- The deprecated API named ``pyramid.security.Unauthorized`` was |
|
5521 |
removed. |
|
5522 |
|
|
5523 |
- The deprecated API named ``pyramid.view.view_execution_permitted`` |
|
5524 |
was removed. |
|
5525 |
|
|
5526 |
- The deprecated API named ``pyramid.view.NotFound`` was removed. |
|
5527 |
|
|
5528 |
- The ``bfgshell`` paster command is now named ``pshell``. |
|
5529 |
|
|
5530 |
- The Venusian "category" for all built-in Venusian decorators |
|
5531 |
(e.g. ``subscriber`` and ``view_config``/``bfg_view``) is now |
|
5532 |
``pyramid`` instead of ``bfg``. |
|
5533 |
|
|
5534 |
- ``pyramid.renderers.rendered_response`` function removed; use |
|
5535 |
``render_pyramid.renderers.render_to_response`` instead. |
|
5536 |
|
|
5537 |
- Renderer factories now accept a *renderer info object* rather than an |
|
5538 |
absolute resource specification or an absolute path. The object has the |
|
5539 |
following attributes: ``name`` (the ``renderer=`` value), ``package`` (the |
|
5540 |
'current package' when the renderer configuration statement was found), |
|
5541 |
``type``: the renderer type, ``registry``: the current registry, and |
|
5542 |
``settings``: the deployment settings dictionary. |
|
5543 |
|
|
5544 |
Third-party ``repoze.bfg`` renderer implementations that must be ported to |
|
5545 |
Pyramid will need to account for this. |
|
5546 |
|
|
5547 |
This change was made primarily to support more flexible Mako template |
|
5548 |
rendering. |
|
5549 |
|
|
5550 |
- The presence of the key ``repoze.bfg.message`` in the WSGI environment when |
|
5551 |
an exception occurs is now deprecated. Instead, code which relies on this |
|
5552 |
environ value should use the ``exception`` attribute of the request |
|
5553 |
(e.g. ``request.exception[0]``) to retrieve the message. |
|
5554 |
|
|
5555 |
- The values ``bfg_localizer`` and ``bfg_locale_name`` kept on the request |
|
5556 |
during internationalization for caching purposes were never APIs. These |
|
5557 |
however have changed to ``localizer`` and ``locale_name``, respectively. |
|
5558 |
|
|
5559 |
- The default ``cookie_name`` value of the ``authtktauthenticationpolicy`` ZCML |
|
5560 |
now defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``). |
|
5561 |
|
|
5562 |
- The default ``cookie_name`` value of the |
|
5563 |
``pyramid.authentication.AuthTktAuthenticationPolicy`` constructor now |
|
5564 |
defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``). |
|
5565 |
|
|
5566 |
- The ``request_type`` argument to the ``view`` ZCML directive, the |
|
5567 |
``pyramid.configuration.Configurator.add_view`` method, or the |
|
5568 |
``pyramid.view.view_config`` decorator (nee ``bfg_view``) is no longer |
|
5569 |
permitted to be one of the strings ``GET``, ``HEAD``, ``PUT``, ``POST`` or |
|
5570 |
``DELETE``, and now must always be an interface. Accepting the |
|
5571 |
method-strings as ``request_type`` was a backwards compatibility strategy |
|
5572 |
servicing repoze.bfg 1.0 applications. Use the ``request_method`` |
|
5573 |
parameter instead to specify that a view a string request-method predicate. |
4cdffc
|
5574 |
|