Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 914 lines (695 sloc) 39.696 kB
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
1 Next Release
2d93140 @mmerickel support acl as a callable
mmerickel authored
2 ============
3
4 Features
5 --------
6
1930ebf @mcdonc Permit escaping of double braces in scaffolds, see #862
mcdonc authored
7 - It is now possible to escape double braces in Pyramid scaffolds (unescaped,
8 these represent replacement values). You can use ``\{\{a\}\}`` to
9 represent a "bare" ``{{a}}``. See
10 https://github.com/Pylons/pyramid/pull/862
11
c614ffc @witsch add ``localizer`` property to the request (refs #508)
witsch authored
12 - Add ``localizer`` property (reified) to the request.
13 See https://github.com/Pylons/pyramid/issues/508.
14
b210ce3 @mcdonc add pdistreport command
mcdonc authored
15 - Add ``pdistreport`` script, which prints the Python version in use, the
16 Pyramid version in use, and the version number and location of all Python
17 distributions currently installed.
18
32333e4 @mcdonc add not_ predicate feature
mcdonc authored
19 - Add the ability to invert the result of any view, route, or subscriber
20 predicate using the ``not_`` class. For example::
21
22 from pyramid.config import not_
23
24 @view_config(route_name='myroute', request_method=not_('POST'))
25 def myview(request): ...
26
27 The above example will ensure that the view is called if the request method
28 is not POST (at least if no other view is more specific).
29
30 The :class:`pyramid.config.not_` class can be used against any value that is
31 a predicate value passed in any of these contexts:
32
33 - ``pyramid.config.Configurator.add_view``
34
35 - ``pyramid.config.Configurator.add_route``
36
37 - ``pyramid.config.Configurator.add_subscriber``
38
39 - ``pyramid.view.view_config``
40
41 - ``pyramid.events.subscriber``
42
a178631 @mcdonc add an entry to changes about code merged from feature.prequest_login…
mcdonc authored
43 - ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH``
44 requests. See https://github.com/Pylons/pyramid/pull/1033. add support for
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
45 submitting ``OPTIONS`` and ``PROPFIND`` requests, and allow users to specify
a178631 @mcdonc add an entry to changes about code merged from feature.prequest_login…
mcdonc authored
46 basic authentication credentials in the request via a ``--login`` argument to
47 the script. See https://github.com/Pylons/pyramid/pull/1039.
f0f92b0 @tseaver Changelog for PR #1033.
tseaver authored
48
2d93140 @mmerickel support acl as a callable
mmerickel authored
49 - ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This
50 removes the ambiguity between the potential ``AttributeError`` that would
51 be raised on the ``context`` when the property was not defined and the
52 ``AttributeError`` that could be raised from any user-defined code within
53 a dynamic property. It is recommended to define a dynamic ACL as a callable
54 to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735.
55
ff41f86 @wosc Fixes #798: Allow a protocol-relative URL to be passed to add_static_…
wosc authored
56 - Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to
57 ``pyramid.config.Configurator.add_static_view``. This allows
58 externally-hosted static URLs to be generated based on the current protocol.
59
a1f768c @wichert Allow explicit cookie domain setting.
wichert authored
60 - The ``AuthTktAuthenticationPolicy`` has two new options to configure its
61 domain usage:
58c5fef @tshepang fix some rST issues
tshepang authored
62
a1f768c @wichert Allow explicit cookie domain setting.
wichert authored
63 * ``parent_domain``: if set the authentication cookie is set on
64 the parent domain. This is useful if you have multiple sites sharing the
65 same domain.
66 * ``domain``: if provided the cookie is always set for this domain, bypassing
58c5fef @tshepang fix some rST issues
tshepang authored
67 all usual logic.
68
3ea7883 @tomster Add reference to the pull requests
tomster authored
69 See https://github.com/Pylons/pyramid/pull/1028,
70 https://github.com/Pylons/pyramid/pull/1072 and
71 https://github.com/Pylons/pyramid/pull/1078.
188aa7e @wichert Add a parent_domain option for auth_tkt policy
wichert authored
72
23a7c6d @mmerickel update CHANGES.txt
mmerickel authored
73 - The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using
74 the ``include_ip=True`` option. This is possibly incompatible with
75 alternative ``auth_tkt`` implementations, as the specification does not
76 define how to properly handle IPv6. See
77 https://github.com/Pylons/pyramid/issues/831.
78
38844f7 @mmerickel update CHANGES.txt
mmerickel authored
79 - Make it possible to use variable arguments via
80 ``pyramid.paster.get_appsettings``. This also allowed the generated
81 ``initialize_db`` script from the ``alchemy`` scaffold to grow support
82 for options in the form ``a=1 b=2`` so you can fill in
83 values in a parameterized ``.ini`` file, e.g.
84 ``initialize_myapp_db etc/development.ini a=1 b=2``.
85 See https://github.com/Pylons/pyramid/pull/911
86
fab8454 @mcdonc add changelog note
mcdonc authored
87 - The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view
88 predicate now take into account the value of the HTTP header named
89 ``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they
90 always did). The header is tried when the form parameter does not exist.
91
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
92 - View lookup will now search for valid views based on the inheritance
93 hierarchy of the context. It tries to find views based on the most
94 specific context first, and upon predicate failure, will move up the
95 inheritance chain to test views found by the super-type of the context.
96 In the past, only the most specific type containing views would be checked
97 and if no matching view could be found then a PredicateMismatch would be
98 raised. Now predicate mismatches don't hide valid views registered on
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
99 super-types. Here's an example that now works:
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
100
101 .. code-block:: python
9e1e6d3 @latteier Change log note.
latteier authored
102
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
103 class IResource(Interface):
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
104
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
105 ...
9e1e6d3 @latteier Change log note.
latteier authored
106
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
107 @view_config(context=IResource)
108 def get(context, request):
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
109
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
110 ...
9e1e6d3 @latteier Change log note.
latteier authored
111
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
112 @view_config(context=IResource, request_method='POST')
113 def post(context, request):
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
114
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
115 ...
9e1e6d3 @latteier Change log note.
latteier authored
116
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
117 @view_config(context=IResource, request_method='DELETE')
118 def delete(context, request):
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
119
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
120 ...
9e1e6d3 @latteier Change log note.
latteier authored
121
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
122 @implementor(IResource)
123 class MyResource:
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
124
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
125 ...
9e1e6d3 @latteier Change log note.
latteier authored
126
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
127 @view_config(context=MyResource, request_method='POST')
128 def override_post(context, request):
07c189d @stevepiercy Fix whitespace in CHANGES.txt to permit build.
stevepiercy authored
129
b6a4d40 @mmerickel Merge branch 'master' of latteier/pyramid into pull.786
mmerickel authored
130 ...
9e1e6d3 @latteier Change log note.
latteier authored
131
132 Previously the override_post view registration would hide the get
133 and delete views in the context of MyResource -- leading to a
134 predicate mismatch error when trying to use GET or DELETE
135 methods. Now the views are found and no predicate mismatch is
136 raised.
6b97003 @mmerickel update changlog
mmerickel authored
137 See https://github.com/Pylons/pyramid/pull/786 and
75fc4ac @mmerickel update changelog
mmerickel authored
138 https://github.com/Pylons/pyramid/pull/1004 and
139 https://github.com/Pylons/pyramid/pull/1046
9e1e6d3 @latteier Change log note.
latteier authored
140
1377480 @mcdonc add change note
mcdonc authored
141 - The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a
142 ``-q`` (or ``--quiet``) flag. Output from running ``pserve`` can be
143 controlled using these flags. ``-v`` can be specified multiple times to
144 increase verbosity. ``-q`` sets verbosity to ``0`` unconditionally. The
145 default verbosity level is ``1``.
146
986dc5f @mcdonc add change note
mcdonc authored
147 - The ``alchemy`` scaffold tests now provide better coverage. See
148 https://github.com/Pylons/pyramid/pull/1029
149
d07d167 @mcdonc raise ValueError instead of generating just path when _app_url is pro…
mcdonc authored
150 - The ``pyramid.config.Configurator.add_route`` method now supports being
151 called with an external URL as pattern. See
152 https://github.com/Pylons/pyramid/issues/611 for more information.
8a8eff5 @tomster update changelog
tomster authored
153
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
154 Bug Fixes
155 ---------
156
8a7e80d @mcdonc - When the ``pyramid.reload_templates`` setting was true, and a Chame…
mcdonc authored
157 - When the ``pyramid.reload_templates`` setting was true, and a Chameleon
158 template was reloaded, and the renderer specification named a macro
159 (e.g. ``foo#macroname.pt``), renderings of the template after the template
160 was reloaded due to a file change would produce the entire template body
161 instead of just a rendering of the macro. See
162 https://github.com/Pylons/pyramid/issues/1013.
163
ece96f6 @mcdonc - Fix an obscure problem when combining a virtual root with a route w…
mcdonc authored
164 - Fix an obscure problem when combining a virtual root with a route with a
165 ``*traverse`` in its pattern. Now the traversal path generated in
166 such a configuration will be correct, instead of an element missing
167 a leading slash.
168
24c9326 @blaflamme added bug fix to changes
blaflamme authored
169 - Fixed a Mako renderer bug returning a tuple with a previous defname value
3de54e3 @blaflamme fixed line indentation
blaflamme authored
170 in some circumstances. See https://github.com/Pylons/pyramid/issues/1037
171 for more information.
24c9326 @blaflamme added bug fix to changes
blaflamme authored
172
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
173 - Make the ``pyramid.config.assets.PackageOverrides`` object implement the API
174 for ``__loader__`` objects specified in PEP 302. Proxies to the
175 ``__loader__`` set by the importer, if present; otherwise, raises
176 ``NotImplementedError``. This makes Pyramid static view overrides work
177 properly under Python 3.3 (previously they would not). See
178 https://github.com/Pylons/pyramid/pull/1015 for more information.
179
180 - ``mako_templating``: added defensive workaround for non-importability of
181 ``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support. Mako
182 templating will no longer work under the combination of MarkupSafe 0.17 and
183 Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any
184 supported Python 2 version will work OK).
185
ea278e1 @mmerickel update changelog
mmerickel authored
186 - Spaces and dots may now be in mako renderer template paths. This was
187 broken when support for the new makodef syntax was added in 1.4a1.
188 See https://github.com/Pylons/pyramid/issues/950
189
20c57e6 @mmerickel update changelog
mmerickel authored
190 - ``pyramid.debug_authorization=true`` will now correctly print out
191 ``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead
192 of invoking the ``permits`` method of the authorization policy.
193 See https://github.com/Pylons/pyramid/issues/954
194
c35b298 @mmerickel update changes.txt
mmerickel authored
195 - Pyramid failed to install on some systems due to being packaged with
196 some test files containing higher order characters in their names. These
197 files have now been removed. See
198 https://github.com/Pylons/pyramid/issues/981
199
050b71c @mcdonc - ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so co…
mcdonc authored
200 - ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under
0d96b77 @mcdonc version bump in setup.py conf.py CHANGES.txt, rejigger changes bugs v…
mcdonc authored
201 Python 3 would use ``__len__`` to find truthiness; this usually caused an
202 instance of DummyResource to be "falsy" instead of "truthy". See
203 https://github.com/Pylons/pyramid/pull/1032
050b71c @mcdonc - ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so co…
mcdonc authored
204
0a8d50f @mcdonc add change note
mcdonc authored
205 - The ``alchemy`` scaffold would break when the database was MySQL during
206 tables creation. See https://github.com/Pylons/pyramid/pull/1049
207
6a4a341 @odontomachus Fixed documentation width, signed contributors agreement and added a …
odontomachus authored
208 - The ``current_route_url`` method now attaches the query string to the URL by
209 default. See
0f1bc52 @odontomachus Updated CHANGES
odontomachus authored
210 https://github.com/Pylons/pyramid/issues/1040
211
d6e8b86 @tomster Make ``pserve.cherrypy_server_runner`` Python 3 compatible.
tomster authored
212 - Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See
213 https://github.com/Pylons/pyramid/issues/718
214
33e0fe1 @odontomachus Fixes to documentation, added change to what's new.
odontomachus authored
215 Backwards Incompatibilities
216 ---------------------------
217
6a4a341 @odontomachus Fixed documentation width, signed contributors agreement and added a …
odontomachus authored
218 - Modified the ``current_route_url`` method in pyramid.Request. The method
219 previously returned the URL without the query string by default, it now does
220 attach the query string unless it is overriden.
33e0fe1 @odontomachus Fixes to documentation, added change to what's new.
odontomachus authored
221
58951c0 @mcdonc - The ``route_url`` and ``route_path`` APIs no longer quote ``/``
mcdonc authored
222 - The ``route_url`` and ``route_path`` APIs no longer quote ``/``
223 to ``%2F`` when a replacement value contains a ``/``. This was pointless,
224 as WSGI servers always unquote the slash anyway, and Pyramid never sees the
225 quoted value.
226
96ab9f2 @mcdonc prep for 1.4
mcdonc authored
227 1.4 (2012-12-18)
228 ================
758fa23 @mcdonc garden
mcdonc authored
229
230 Docs
231 ----
232
233 - Fix functional tests in the ZODB tutorial
234
e609e19 @mcdonc prep for 1.4b3
mcdonc authored
235 1.4b3 (2012-12-10)
236 ==================
237
238 - Packaging release only, no code changes. 1.4b2 was a brownbag release due to
239 missing directories in the tarball.
240
a7e0e60 @mcdonc prep for 1.4b2
mcdonc authored
241 1.4b2 (2012-12-10)
242 ==================
243
244 Docs
245 ----
246
247 - Scaffolding is now PEP-8 compliant (at least for a brief shining moment).
248
249 - Tutorial improvements.
ed14191 @mmerickel _depth argument to view_config is now relative to view_config
mmerickel authored
250
251 Backwards Incompatibilities
252 ---------------------------
253
254 - Modified the ``_depth`` argument to ``pyramid.view.view_config`` to accept
255 a value relative to the invocation of ``view_config`` itself. Thus, when it
256 was previously expecting a value of ``1`` or greater, to reflect that
257 the caller of ``view_config`` is 1 stack frame away from ``venusian.attach``,
258 this implementation detail is now hidden.
259
a078e19 @mcdonc add changenote
mcdonc authored
260 - Modified the ``_backframes`` argument to ``pyramid.util.action_method`` in a
261 similar way to the changes described to ``_depth`` above. This argument
262 remains undocumented, but might be used in the wild by some insane person.
263
1608b26 @mcdonc prep for 1.4b1
mcdonc authored
264 1.4b1 (2012-11-21)
265 ==================
0ccdc23 @mcdonc - A failure when trying to locate the attribute ``__text__`` on route…
mcdonc authored
266
71cd93b @mcdonc - Small microspeed enhancement which anticipates that a
mcdonc authored
267 Features
268 --------
269
270 - Small microspeed enhancement which anticipates that a
271 ``pyramid.response.Response`` object is likely to be returned from a view.
272 Some code is shortcut if the class of the object returned by a view is this
273 class. A similar microoptimization was done to
274 ``pyramid.request.Request.is_response``.
275
9132f65 @mcdonc garden
mcdonc authored
276 - Make it possible to use variable arguments on ``p*`` commands (``pserve``,
277 ``pshell``, ``pviews``, etc) in the form ``a=1 b=2`` so you can fill in
278 values in parameterized ``.ini`` file, e.g. ``pshell etc/development.ini
6ba0fc7 @mcdonc garden
mcdonc authored
279 http_port=8080``. See https://github.com/Pylons/pyramid/pull/714
9132f65 @mcdonc garden
mcdonc authored
280
f700d37 @mcdonc garden
mcdonc authored
281 - A somewhat advanced and obscure feature of Pyramid event handlers is their
282 ability to handle "multi-interface" notifications. These notifications have
283 traditionally presented multiple objects to the subscriber callable. For
284 instance, if an event was sent by code like this::
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
285
286 registry.notify(event, context)
287
288 In the past, in order to catch such an event, you were obligated to write and
289 register an event subscriber that mentioned both the event and the context in
290 its argument list::
291
292 @subscriber([SomeEvent, SomeContextType])
f700d37 @mcdonc garden
mcdonc authored
293 def asubscriber(event, context):
294 pass
295
296 In many subscriber callables registered this way, it was common for the logic
297 in the subscriber callable to completely ignore the second and following
298 arguments (e.g. ``context`` in the above example might be ignored), because
299 they usually existed as attributes of the event anyway. You could usually
a3810e7 @mcdonc garden
mcdonc authored
300 get the same value by doing ``event.context`` or similar.
f700d37 @mcdonc garden
mcdonc authored
301
302 The fact that you needed to put an extra argument which you usually ignored
303 in the subscriber callable body was only a minor annoyance until we added
a3810e7 @mcdonc garden
mcdonc authored
304 "subscriber predicates", used to narrow the set of circumstances under which
305 a subscriber will be executed, in a prior 1.4 alpha release. Once those were
306 added, the annoyance was escalated, because subscriber predicates needed to
307 accept the same argument list and arity as the subscriber callables that they
308 were configured against. So, for example, if you had these two subscriber
309 registrations in your code::
f700d37 @mcdonc garden
mcdonc authored
310
311 @subscriber([SomeEvent, SomeContextType])
312 def asubscriber(event, context):
313 pass
314
315 @subscriber(SomeOtherEvent)
316 def asubscriber(event):
317 pass
24c9326 @blaflamme added bug fix to changes
blaflamme authored
318
f700d37 @mcdonc garden
mcdonc authored
319 And you wanted to use a subscriber predicate::
320
321 @subscriber([SomeEvent, SomeContextType], mypredicate=True)
a3810e7 @mcdonc garden
mcdonc authored
322 def asubscriber1(event, context):
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
323 pass
324
f700d37 @mcdonc garden
mcdonc authored
325 @subscriber(SomeOtherEvent, mypredicate=True)
a3810e7 @mcdonc garden
mcdonc authored
326 def asubscriber2(event):
f700d37 @mcdonc garden
mcdonc authored
327 pass
328
a3810e7 @mcdonc garden
mcdonc authored
329 If an existing ``mypredicate`` subscriber predicate had been written in such
330 a way that it accepted only one argument in its ``__call__``, you could not
331 use it against a subscription which named more than one interface in its
332 subscriber interface list. Similarly, if you had written a subscriber
333 predicate that accepted two arguments, you couldn't use it against a
334 registration that named only a single interface type.
335
336 For example, if you created this predicate::
f700d37 @mcdonc garden
mcdonc authored
337
338 class MyPredicate(object):
339 # portions elided...
340 def __call__(self, event):
341 return self.val == event.context.foo
342
a3810e7 @mcdonc garden
mcdonc authored
343 It would not work against a multi-interface-registered subscription, so in
344 the above example, when you attempted to use it against ``asubscriber1``, it
345 would fail at runtime with a TypeError, claiming something was attempting to
346 call it with too many arguments.
f700d37 @mcdonc garden
mcdonc authored
347
a3810e7 @mcdonc garden
mcdonc authored
348 To hack around this limitation, you were obligated to design the
349 ``mypredicate`` predicate to expect to receive in its ``__call__`` either a
350 single ``event`` argument (a SomeOtherEvent object) *or* a pair of arguments
351 (a SomeEvent object and a SomeContextType object), presumably by doing
352 something like this::
f700d37 @mcdonc garden
mcdonc authored
353
354 class MyPredicate(object):
355 # portions elided...
356 def __call__(self, event, context=None):
357 return self.val == event.context.foo
358
359 This was confusing and bad.
360
361 In order to allow people to ignore unused arguments to subscriber callables
362 and to normalize the relationship between event subscribers and subscriber
363 predicates, we now allow both subscribers and subscriber predicates to accept
364 only a single ``event`` argument even if they've been subscribed for
365 notifications that involve multiple interfaces. Subscribers and subscriber
366 predicates that accept only one argument will receive the first object passed
367 to ``notify``; this is typically (but not always) the event object. The
368 other objects involved in the subscription lookup will be discarded. You can
369 now write an event subscriber that accepts only ``event`` even if it
370 subscribes to multiple interfaces::
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
371
372 @subscriber([SomeEvent, SomeContextType])
f700d37 @mcdonc garden
mcdonc authored
373 def asubscriber(event):
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
374 # this will work!
375
f700d37 @mcdonc garden
mcdonc authored
376 This prevents you from needing to match the subscriber callable parameters to
377 the subscription type unnecessarily, especially when you don't make use of
378 any argument in your subscribers except for the event object itself.
379
380 Note, however, that if the event object is not the first
381 object in the call to ``notify``, you'll run into trouble. For example, if
382 notify is called with the context argument first::
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
383
384 registry.notify(context, event)
385
f700d37 @mcdonc garden
mcdonc authored
386 You won't be able to take advantage of the event-only feature. It will
387 "work", but the object received by your event handler won't be the event
388 object, it will be the context object, which won't be very useful::
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
389
390 @subscriber([SomeContextType, SomeEvent])
f700d37 @mcdonc garden
mcdonc authored
391 def asubscriber(event):
24c9326 @blaflamme added bug fix to changes
blaflamme authored
392 # bzzt! you'll be getting the context here as ``event``, and it'll
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
393 # be useless
394
395 Existing multiple-argument subscribers continue to work without issue, so you
396 should continue use those if your system notifies using multiple interfaces
397 and the first interface is not the event interface. For example::
398
399 @subscriber([SomeContextType, SomeEvent])
f700d37 @mcdonc garden
mcdonc authored
400 def asubscriber(context, event):
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
401 # this will still work!
402
403 The event-only feature makes it possible to use a subscriber predicate that
404 accepts only a request argument within both multiple-interface subscriber
f700d37 @mcdonc garden
mcdonc authored
405 registrations and single-interface subscriber registrations. You needn't
406 make slightly different variations of predicates depending on the
407 subscription type arguments. Instead, just write all your subscriber
408 predicates so they only accept ``event`` in their ``__call__`` and they'll be
409 useful across all registrations for subscriptions that use an event as their
410 first argument, even ones which accept more than just ``event``.
411
412 However, the same caveat applies to predicates as to subscriber callables: if
413 you're subscribing to a multi-interface event, and the first interface is not
414 the event interface, the predicate won't work properly. In such a case,
415 you'll need to match the predicate ``__call__`` argument ordering and
416 composition to the ordering of the interfaces. For example, if the
417 registration for the subscription uses ``[SomeContext, SomeEvent]``, you'll
418 need to reflect that in the ordering of the parameters of the predicate's
419 ``__call__`` method::
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
420
421 def __call__(self, context, event):
422 return event.request.path.startswith(self.val)
423
f700d37 @mcdonc garden
mcdonc authored
424 tl;dr: 1) When using multi-interface subscriptions, always use the event type
425 as the first subscription registration argument and 2) When 1 is true, use
426 only ``event`` in your subscriber and subscriber predicate parameter lists,
427 no matter how many interfaces the subscriber is notified with. This
428 combination will result in the maximum amount of reusability of subscriber
429 predicates and the least amount of thought on your part. Drink responsibly.
28fc3d5 @mcdonc - In order to normalize the relationship between event subscribers and
mcdonc authored
430
0ccdc23 @mcdonc - A failure when trying to locate the attribute ``__text__`` on route…
mcdonc authored
431 Bug Fixes
432 ---------
433
434 - A failure when trying to locate the attribute ``__text__`` on route and view
435 predicates existed when the ``debug_routematch`` setting was true or when the
436 ``pviews`` command was used. See https://github.com/Pylons/pyramid/pull/727
437
b5e4443 @mcdonc garden
mcdonc authored
438 Documentation
439 -------------
440
441 - Sync up tutorial source files with the files that are rendered by the
442 scaffold that each uses.
443
9480686 @mcdonc prep for release
mcdonc authored
444 1.4a4 (2012-11-14)
445 ==================
c7337ba @mcdonc - Added an ``effective_principals`` route and view predicate.
mcdonc authored
446
447 Features
448 --------
449
19b8207 @mmerickel merged SHA512AuthTktAuthenticationPolicy into AuthTktAuthenticationPo…
mmerickel authored
450 - ``pyramid.authentication.AuthTktAuthenticationPolicy`` has been updated to
451 support newer hashing algorithms such as ``sha512``. Existing applications
39ef68d @mcdonc rearrange deck chairs
mcdonc authored
452 should consider updating if possible for improved security over the default
453 md5 hashing.
19b8207 @mmerickel merged SHA512AuthTktAuthenticationPolicy into AuthTktAuthenticationPo…
mmerickel authored
454
c7337ba @mcdonc - Added an ``effective_principals`` route and view predicate.
mcdonc authored
455 - Added an ``effective_principals`` route and view predicate.
456
07c9ee0 @mcdonc - Do not allow the userid returned from the ``authenticated_userid`` …
mcdonc authored
457 - Do not allow the userid returned from the ``authenticated_userid`` or the
458 userid that is one of the list of principals returned by
459 ``effective_principals`` to be either of the strings ``system.Everyone`` or
460 ``system.Authenticated`` when any of the built-in authorization policies that
461 live in ``pyramid.authentication`` are in use. These two strings are
462 reserved for internal usage by Pyramid and they will not be accepted as valid
463 userids.
464
ca46568 @mmerickel garden
mmerickel authored
465 - Slightly better debug logging from
466 ``pyramid.authentication.RepozeWho1AuthenticationPolicy``.
47146eb @mcdonc garden
mcdonc authored
467
39ef68d @mcdonc rearrange deck chairs
mcdonc authored
468 - ``pyramid.security.view_execution_permitted`` used to return ``True`` if no
926fb68 @mcdonc resolve merge conflict
mcdonc authored
469 view could be found. It now raises a ``TypeError`` exception in that case, as
470 it doesn't make sense to assert that a nonexistent view is
471 execution-permitted. See https://github.com/Pylons/pyramid/issues/299.
6099144 @mmerickel updated changes
mmerickel authored
472
a8d71ca @mcdonc - Allow a ``_depth`` argument to ``pyramid.view.view_config``, which …
mcdonc authored
473 - Allow a ``_depth`` argument to ``pyramid.view.view_config``, which will
474 permit limited composition reuse of the decorator by other software that
475 wants to provide custom decorators that are much like view_config.
476
1701243 @mmerickel update changelog, close #627
mmerickel authored
477 - Allow an iterable of decorators to be passed to
478 ``pyramid.config.Configurator.add_view``. This allows views to be wrapped
479 by more than one decorator without requiring combining the decorators
480 yourself.
481
a007a4f @mcdonc - In the past if a renderer returned ``None``, the body of the resulting
mcdonc authored
482 Bug Fixes
483 ---------
484
485 - In the past if a renderer returned ``None``, the body of the resulting
486 response would be set explicitly to the empty string. Instead, now, the body
487 is left unchanged, which allows the renderer to set a body itself by using
488 e.g. ``request.response.body = b'foo'``. The body set by the renderer will
489 be unmolested on the way out. See
490 https://github.com/Pylons/pyramid/issues/709
491
34d4cd0 @mcdonc - In uncommon cases, the ``pyramid_excview_tween_factory`` might have
mcdonc authored
492 - In uncommon cases, the ``pyramid_excview_tween_factory`` might have
493 inadvertently raised a ``KeyError`` looking for ``request_iface`` as an
494 attribute of the request. It no longer fails in this case. See
495 https://github.com/Pylons/pyramid/issues/700
496
267dbd2 @mcdonc - Be more tolerant of potential error conditions in ``match_param`` and
mcdonc authored
497 - Be more tolerant of potential error conditions in ``match_param`` and
498 ``physical_path`` predicate implementations; instead of raising an exception,
499 return False.
500
39ef68d @mcdonc rearrange deck chairs
mcdonc authored
501 - ``pyramid.view.render_view`` was not functioning properly under Python 3.x
502 due to a byte/unicode discrepancy. See
cd8ac80 @tshepang update some links and fix others
tshepang authored
503 https://github.com/Pylons/pyramid/issues/721
f89cfcd @mmerickel updated changelog
mmerickel authored
504
ca3df80 @mmerickel emit a warning if a user is using the default hashalg to AuthTkt
mmerickel authored
505 Deprecations
506 ------------
507
39ef68d @mcdonc rearrange deck chairs
mcdonc authored
508 - ``pyramid.authentication.AuthTktAuthenticationPolicy`` will emit a warning if
509 an application is using the policy without explicitly passing a ``hashalg``
510 argument. This is because the default is "md5" which is considered
511 theoretically subject to collision attacks. If you really want "md5" then you
512 must specify it explicitly to get rid of the warning.
513
514 Documentation
515 -------------
516
517 - All of the tutorials that use
518 ``pyramid.authentication.AuthTktAuthenticationPolicy`` now explicitly pass
519 ``sha512`` as a ``hashalg`` argument.
520
ca3df80 @mmerickel emit a warning if a user is using the default hashalg to AuthTkt
mmerickel authored
521
66fe1d0 @mcdonc - Move ``TopologicalSorter`` from ``pyramid.config.util`` to ``pyrami…
mcdonc authored
522 Internals
523 ---------
524
525 - Move ``TopologicalSorter`` from ``pyramid.config.util`` to ``pyramid.util``,
526 move ``CyclicDependencyError`` from ``pyramid.config.util`` to
527 ``pyramid.exceptions``, rename ``Singleton`` to ``Sentinel`` and move from
ca46568 @mmerickel garden
mmerickel authored
528 ``pyramid.config.util`` to ``pyramid.util``; this is in an effort to
0487545 @mcdonc fix docs, upgrade tutorials, add change note, deprecate using zope.de…
mcdonc authored
529 move that stuff that may be an API one day out of ``pyramid.config.util``,
66fe1d0 @mcdonc - Move ``TopologicalSorter`` from ``pyramid.config.util`` to ``pyrami…
mcdonc authored
530 because that package should never be imported from non-Pyramid code.
531 TopologicalSorter is still not an API, but may become one.
532
39ef68d @mcdonc rearrange deck chairs
mcdonc authored
533 - Get rid of shady monkeypatching of ``pyramid.request.Request`` and
534 ``pyramid.response.Response`` done within the ``__init__.py`` of Pyramid.
535 Webob no longer relies on this being done. Instead, the ResponseClass
536 attribute of the Pyramid Request class is assigned to the Pyramid response
537 class; that's enough to satisfy WebOb and behave as it did before with the
538 monkeypatching.
539
4a6cca6 @mcdonc prep for 1.4a3
mcdonc authored
540 1.4a3 (2012-10-26)
541 ==================
d6fb001 @mcdonc - 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series
mcdonc authored
542
543 Bug Fixes
544 ---------
545
06a904f @mcdonc add docs and changelog note
mcdonc authored
546 - The match_param predicate's text method was fixed to sort its values.
547 Part of https://github.com/Pylons/pyramid/pull/705
548
d6fb001 @mcdonc - 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series
mcdonc authored
549 - 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series
550 function of same name. In particular, if passed a request, it would not
551 set the ``registry`` attribute of the request like 1.3 did. A symptom
552 would be that passing a request to ``pyramid.paster.bootstrap`` (which uses
553 the function) that did not have a ``registry`` attribute could assume that
554 the registry would be attached to the request by Pyramid. This assumption
555 could be made in 1.3, but not in 1.4. The assumption can now be made in
556 1.4 too (a registry is attached to a request passed to bootstrap or
557 prepare).
558
66d277a @mcdonc garden
mcdonc authored
559 - When registering a view configuration that named a Chameleon ZPT renderer
560 with a macro name in it (e.g. ``renderer='some/template#somemacro.pt``) as
043ccdd @tshepang eliminate other repeated words
tshepang authored
561 well as a view configuration without a macro name in it that pointed to the
9937a4e @chrisrossi Fix rst syntax error which prevented Sphinx docs from building.
chrisrossi authored
562 same template (e.g. ``renderer='some/template.pt'``), internal caching could
66d277a @mcdonc garden
mcdonc authored
563 confuse the two, and your code might have rendered one instead of the
564 other.
565
1273d56 @mcdonc - The Configurator ``testing_securitypolicy`` method now returns the …
mcdonc authored
566 Features
567 --------
568
c25a8fd @mcdonc - New ``physical_path`` view predicate. If specified, this value sho…
mcdonc authored
569 - Allow multiple values to be specified to the ``request_param`` view/route
570 predicate as a sequence. Previously only a single string value was allowed.
571 See https://github.com/Pylons/pyramid/pull/705
572
573 - Comments with references to documentation sections placed in scaffold
574 ``.ini`` files.
575
576 - Added an HTTP Basic authentication policy
577 at ``pyramid.authentication.BasicAuthAuthenticationPolicy``.
578
1273d56 @mcdonc - The Configurator ``testing_securitypolicy`` method now returns the …
mcdonc authored
579 - The Configurator ``testing_securitypolicy`` method now returns the policy
580 object it creates.
581
582 - The Configurator ``testing_securitypolicy`` method accepts two new
583 arguments: ``remember_result`` and ``forget_result``. If supplied, these
584 values influence the result of the policy's ``remember`` and ``forget``
585 methods, respectively.
586
587 - The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a
588 ``forgotten`` value on the policy (the value ``True``) when its ``forget``
589 method is called.
590
591 - The DummySecurityPolicy created by ``testing_securitypolicy`` now sets a
592 ``remembered`` value on the policy, which is the value of the ``principal``
593 argument it's called with when its ``remember`` method is called.
594
c25a8fd @mcdonc - New ``physical_path`` view predicate. If specified, this value sho…
mcdonc authored
595 - New ``physical_path`` view predicate. If specified, this value should be a
596 string or a tuple representing the physical traversal path of the context
597 found via traversal for this predicate to match as true. For example:
598 ``physical_path='/'`` or ``physical_path='/a/b/c'`` or ``physical_path=('',
599 'a', 'b', 'c')``. This is not a path prefix match or a regex, it's a
600 whole-path match. It's useful when you want to always potentially show a
601 view when some object is traversed to, but you can't be sure about what kind
602 of object it will be, so you can't use the ``context`` predicate. The
603 individual path elements inbetween slash characters or in tuple elements
604 should be the Unicode representation of the name of the resource and should
605 not be encoded in any way.
606
072cbf7 @mcdonc prep for 1.4a2
mcdonc authored
607 1.4a2 (2012-09-27)
608 ==================
68c25d3 @mcdonc garden
mcdonc authored
609
d27bc79 @mcdonc garden
mcdonc authored
610 Bug Fixes
611 ---------
612
4388d31 @mcdonc mirror john's change for chameleon, better changelog message
mcdonc authored
613 - When trying to determine Mako defnames and Chameleon macro names in asset
614 specifications, take into account that the filename may have a hyphen in
615 it. See https://github.com/Pylons/pyramid/pull/692
d27bc79 @mcdonc garden
mcdonc authored
616
68c25d3 @mcdonc garden
mcdonc authored
617 Features
618 --------
619
620 - A new ``pyramid.session.check_csrf_token`` convenience function was added.
621
80cd0b1 @mcdonc garden
mcdonc authored
622 - A ``check_csrf`` view predicate was added. For example, you can now do
623 ``config.add_view(someview, check_csrf=True)``. When the predicate is
624 checked, if the ``csrf_token`` value in ``request.params`` matches the CSRF
625 token in the request's session, the view will be permitted to execute.
626 Otherwise, it will not be permitted to execute.
68c25d3 @mcdonc garden
mcdonc authored
627
098599b @mcdonc - Add ``Base.metadata.bind = engine`` to alchemy template, so that ta…
mcdonc authored
628 - Add ``Base.metadata.bind = engine`` to alchemy template, so that tables
629 defined imperatively will work.
630
631 Documentation
632 -------------
633
634 - update wiki2 SQLA tutorial with the changes required after inserting
635 ``Base.metadata.bind = engine`` into the alchemy scaffold.
636
ce1e86c @mcdonc prep for 1.4a1
mcdonc authored
637 1.4a1 (2012-09-16)
638 ==================
f6bd88e @mcdonc trivial change to poke jenkins (im in on an untrusted network and can…
mcdonc authored
639
a39dd2f @mcdonc - Add ``REMOTE_ADDR`` to the ``prequest`` WSGI environ dict for benef…
mcdonc authored
640 Bug Fixes
641 ---------
642
1794b4b @mcdonc note that this is a forward port
mcdonc authored
643 - Forward port from 1.3 branch: When no authentication policy was configured,
644 a call to ``pyramid.security.effective_principals`` would unconditionally
645 return the empty list. This was incorrect, it should have unconditionally
646 returned ``[Everyone]``, and now does.
8782def @mcdonc - When no authentication policy was configured, a call to
mcdonc authored
647
3074e78 @mcdonc garden
mcdonc authored
648 - Explicit url dispatch regexes can now contain colons.
649 https://github.com/Pylons/pyramid/issues/629
650
e652518 @mcdonc - On at least one 64-bit Ubuntu system under Python 3.2, using the
mcdonc authored
651 - On at least one 64-bit Ubuntu system under Python 3.2, using the
652 ``view_config`` decorator caused a ``RuntimeError: dictionary changed size
653 during iteration`` exception. It no longer does. See
654 https://github.com/Pylons/pyramid/issues/635 for more information.
655
8b26752 @blaflamme added entry to changes.txt for mako fix
blaflamme authored
656 - In Mako Templates lookup, check if the uri is already adjusted and bring
657 it back to an asset spec. Normally occurs with inherited templates or
658 included components.
659 https://github.com/Pylons/pyramid/issues/606
660 https://github.com/Pylons/pyramid/issues/607
661
24c9326 @blaflamme added bug fix to changes
blaflamme authored
662 - In Mako Templates lookup, check for absolute uri (using mako directories)
7853bc0 @blaflamme garden
blaflamme authored
663 when mixing up inheritance with asset specs.
664 https://github.com/Pylons/pyramid/issues/662
665
75a8ff4 @mmerickel updated CHANGES with accept-header bug fix
mmerickel authored
666 - HTTP Accept headers were not being normalized causing potentially
667 conflicting view registrations to go unnoticed. Two views that only
668 differ in the case ('text/html' vs. 'text/HTML') will now raise an error.
669 https://github.com/Pylons/pyramid/pull/620
670
a9289d9 @mcdonc - Forward-port from 1.3 branch: when registering multiple views with an
mcdonc authored
671 - Forward-port from 1.3 branch: when registering multiple views with an
672 ``accept`` predicate in a Pyramid application runing under Python 3, you
673 might have received a ``TypeError: unorderable types: function() <
674 function()`` exception.
675
de797c4 @mcdonc - Coverage and docs updates for custom JSON class.
mcdonc authored
676 Features
677 --------
a39dd2f @mcdonc - Add ``REMOTE_ADDR`` to the ``prequest`` WSGI environ dict for benef…
mcdonc authored
678
d246597 @mcdonc reclassify bug as feature
mcdonc authored
679 - Configurator.add_directive now accepts arbitrary callables like partials or
680 objects implementing ``__call__`` which dont have ``__name__`` and
681 ``__doc__`` attributes. See https://github.com/Pylons/pyramid/issues/621
682 and https://github.com/Pylons/pyramid/pull/647.
683
95f766b @mcdonc Subscriber predicates:
mcdonc authored
684 - Third-party custom view, route, and subscriber predicates can now be added
685 for use by view authors via
686 ``pyramid.config.Configurator.add_view_predicate``,
687 ``pyramid.config.Configurator.add_route_predicate`` and
688 ``pyramid.config.Configurator.add_subscriber_predicate``. So, for example,
0196b2a @mcdonc add docs for third-party view predicates
mcdonc authored
689 doing this::
690
691 config.add_view_predicate('abc', my.package.ABCPredicate)
692
693 Might allow a view author to do this in an application that configured that
694 predicate::
695
696 @view_config(abc=1)
697
95f766b @mcdonc Subscriber predicates:
mcdonc authored
698 Similar features exist for ``add_route``, and ``add_subscriber``. See
699 "Adding A Third Party View, Route, or Subscriber Predicate" in the Hooks
700 chapter for more information.
0196b2a @mcdonc add docs for third-party view predicates
mcdonc authored
701
735abf4 @mcdonc note conflict behavior change
mcdonc authored
702 Note that changes made to support the above feature now means that only
703 actions registered using the same "order" can conflict with one another.
704 It used to be the case that actions registered at different orders could
705 potentially conflict, but to my knowledge nothing ever depended on this
706 behavior (it was a bit silly).
707
de797c4 @mcdonc - Coverage and docs updates for custom JSON class.
mcdonc authored
708 - Custom objects can be made easily JSON-serializable in Pyramid by defining
709 a ``__json__`` method on the object's class. This method should return
710 values natively serializable by ``json.dumps`` (such as ints, lists,
711 dictionaries, strings, and so forth).
077fa3a @mcdonc add change note
mcdonc authored
712
e012aa1 @mcdonc allow __json__ and custom adapters to accept request arg
mcdonc authored
713 - The JSON renderer now allows for the definition of custom type adapters to
714 convert unknown objects to JSON serializations.
715
360f251 @mcdonc - As of this release, the ``request_method`` predicate, when used, wi…
mcdonc authored
716 - As of this release, the ``request_method`` predicate, when used, will also
717 imply that ``HEAD`` is implied when you use ``GET``. For example, using
718 ``@view_config(request_method='GET')`` is equivalent to using
561a443 @mcdonc fix example
mcdonc authored
719 ``@view_config(request_method=('GET', 'HEAD'))``. Using
360f251 @mcdonc - As of this release, the ``request_method`` predicate, when used, wi…
mcdonc authored
720 ``@view_config(request_method=('GET', 'POST')`` is equivalent to using
721 ``@view_config(request_method=('GET', 'HEAD', 'POST')``. This is because
722 HEAD is a variant of GET that omits the body, and WebOb has special support
723 to return an empty body when a HEAD is used.
15c40a1 @mcdonc readme
mcdonc authored
724
023c88b @mcdonc rename set_request_method to add_request_method. closes #683
mcdonc authored
725 - ``config.add_request_method`` has been introduced to support extending
2c25342 @mmerickel docs-deprecated set_request_property
mmerickel authored
726 request objects with arbitrary callables. This method expands on the
727 previous ``config.set_request_property`` by supporting methods as well as
728 properties. This method now causes less code to be executed at
729 request construction time than ``config.set_request_property`` in
730 version 1.3.
731
732 - Don't add a ``?`` to URLs generated by ``request.resource_url`` if the
fcb2095 @mcdonc garden
mcdonc authored
733 ``query`` argument is provided but empty.
734
2c25342 @mmerickel docs-deprecated set_request_property
mmerickel authored
735 - Don't add a ``?`` to URLs generated by ``request.route_url`` if the
fcb2095 @mcdonc garden
mcdonc authored
736 ``_query`` argument is provided but empty.
988035a @mcdonc add a change note
mcdonc authored
737
738 - The static view machinery now raises (rather than returns) ``HTTPNotFound``
739 and ``HTTPMovedPermanently`` exceptions, so these can be caught by the
cec2b05 @tshepang consistency
tshepang authored
740 Not Found View (and other exception views).
ea009a6 @blaflamme added docs and changes for using defs in mako renderer
blaflamme authored
741
54d3e3e @mcdonc add a whatsnew-1.4 document
mcdonc authored
742 - The Mako renderer now supports a def name in an asset spec. When the def
8b55a68 @mcdonc garden
mcdonc authored
743 name is present in the asset spec, the system will render the template def
744 within the template and will return the result. An example asset spec is
745 ``package:path/to/template#defname.mako``. This will render the def named
54d3e3e @mcdonc add a whatsnew-1.4 document
mcdonc authored
746 ``defname`` inside the ``template.mako`` template instead of rendering the
747 entire template. The old way of returning a tuple in the form
748 ``('defname', {})`` from the view is supported for backward compatibility,
8b55a68 @mcdonc garden
mcdonc authored
749
750 - The Chameleon ZPT renderer now accepts a macro name in an asset spec. When
751 the macro name is present in the asset spec, the system will render the
752 macro listed as a ``define-macro`` and return the result instead of
753 rendering the entire template. An example asset spec:
754 ``package:path/to/template#macroname.pt``. This will render the macro
755 defined as ``macroname`` within the ``template.pt`` template instead of the
756 entire templae.
61a57ea @mcdonc - When there is a predicate mismatch exception (seen when no view mat…
mcdonc authored
757
758 - When there is a predicate mismatch exception (seen when no view matches for
759 a given request due to predicates not working), the exception now contains
760 a textual description of the predicate which didn't match.
6b180cb @mcdonc - An ``add_permission`` directive method was added to the Configurato…
mcdonc authored
761
762 - An ``add_permission`` directive method was added to the Configurator. This
763 directive registers a free-standing permission introspectable into the
764 Pyramid introspection system. Frameworks built atop Pyramid can thus use
08c2217 @tshepang eliminate repeated "the" words
tshepang authored
765 the ``permissions`` introspectable category data to build a
6b180cb @mcdonc - An ``add_permission`` directive method was added to the Configurato…
mcdonc authored
766 comprehensive list of permissions supported by a running system. Before
767 this method was added, permissions were already registered in this
768 introspectable category as a side effect of naming them in an ``add_view``
769 call, this method just makes it possible to arrange for a permission to be
770 put into the ``permissions`` introspectable category without naming it
771 along with an associated view. Here's an example of usage of
772 ``add_permission``::
773
774 config = Configurator()
775 config.add_permission('view')
2c25342 @mmerickel docs-deprecated set_request_property
mmerickel authored
776
45b6e19 @mmerickel added cookie session changes to CHANGES.txt
mmerickel authored
777 - The ``UnencryptedCookieSessionFactoryConfig`` now accepts
778 ``signed_serialize`` and ``signed_deserialize`` hooks which may be used
779 to influence how the sessions are marshalled (by default this is done
780 with HMAC+pickle).
781
28dba04 @mcdonc - ``pyramid.testing.DummyRequest`` now supports methods supplied by the
mcdonc authored
782 - ``pyramid.testing.DummyRequest`` now supports methods supplied by the
783 ``pyramid.util.InstancePropertyMixin`` class such as ``set_property``.
784
7359873 @mcdonc - Request properties and methods added via ``config.set_request_prope…
mcdonc authored
785 - Request properties and methods added via ``config.set_request_property`` or
786 ``config.add_request_method`` are now available to tweens.
787
788 - Request properties and methods added via ``config.set_request_property`` or
789 ``config.add_request_method`` are now available in the request object
790 returned from ``pyramid.paster.bootstrap``.
791
dc8b49f @mcdonc garden
mcdonc authored
792 - ``request.context`` of environment request during ``bootstrap`` is now the
793 root object if a context isn't already set on a provided request.
794
07cb8f0 @mcdonc add pyramid.decorator.reify as an API. Closes #682
mcdonc authored
795 - The ``pyramid.decorator.reify`` function is now an API, and was added to
796 the API documentation.
797
97150cc @mcdonc merge jinty's testConfig code
mcdonc authored
798 - Added the ``pyramid.testing.testConfig`` context manager, which can be used
799 to generate a configurator in a test, e.g. ``with testing.testConfig(...):``.
800
64452ed @mcdonc rename subrequest to invoke_subrequest
mcdonc authored
801 - Users can now invoke a subrequest from within view code using a new
802 ``request.invoke_subrequest`` API.
37d2c22 @mcdonc docs and test
mcdonc authored
803
2c25342 @mmerickel docs-deprecated set_request_property
mmerickel authored
804 Deprecations
805 ------------
806
9cdb286 @mcdonc readd set_request_property to docs (just so when people run across it…
mcdonc authored
807 - The ``pyramid.config.Configurator.set_request_property`` has been
808 documentation-deprecated. The method remains usable but the more
023c88b @mcdonc rename set_request_method to add_request_method. closes #683
mcdonc authored
809 featureful ``pyramid.config.Configurator.add_request_method`` should be
9cdb286 @mcdonc readd set_request_property to docs (just so when people run across it…
mcdonc authored
810 used in its place (it has all of the same capabilities but can also extend
811 the request object with methods).
ebcdc7c @mcdonc - It is no longer possible to pass an environ dictionary directly to
mcdonc authored
812
813 Backwards Incompatibilities
814 ---------------------------
815
25d3ddf @mcdonc garden
mcdonc authored
816 - The Pyramid router no longer adds the values ``bfg.routes.route`` or
ebcdc7c @mcdonc - It is no longer possible to pass an environ dictionary directly to
mcdonc authored
817 ``bfg.routes.matchdict`` to the request's WSGI environment dictionary.
818 These values were docs-deprecated in ``repoze.bfg`` 1.0 (effectively seven
819 minor releases ago). If your code depended on these values, use
820 request.matched_route and request.matchdict instead.
821
822 - It is no longer possible to pass an environ dictionary directly to
823 ``pyramid.traversal.ResourceTreeTraverser.__call__`` (aka
824 ``ModelGraphTraverser.__call__``). Instead, you must pass a request
825 object. Passing an environment instead of a request has generated a
826 deprecation warning since Pyramid 1.1.
827
828 - Pyramid will no longer work properly if you use the
829 ``webob.request.LegacyRequest`` as a request factory. Instances of the
830 LegacyRequest class have a ``request.path_info`` which return a string.
831 This Pyramid release assumes that ``request.path_info`` will
832 unconditionally be Unicode.
833
3d42722 @mcdonc - The functions from ``pyramid.chameleon_zpt`` and ``pyramid.chameleo…
mcdonc authored
834 - The functions from ``pyramid.chameleon_zpt`` and ``pyramid.chameleon_text``
835 named ``get_renderer``, ``get_template``, ``render_template``, and
836 ``render_template_to_response`` have been removed. These have issued a
837 deprecation warning upon import since Pyramid 1.0. Use
838 ``pyramid.renderers.get_renderer()``,
839 ``pyramid.renderers.get_renderer().implementation()``,
840 ``pyramid.renderers.render()`` or ``pyramid.renderers.render_to_response``
841 respectively instead of these functions.
842
94a6f35 @mcdonc - The ``pyramid.configuration`` module was removed. It had been depr…
mcdonc authored
843 - The ``pyramid.configuration`` module was removed. It had been deprecated
844 since Pyramid 1.0 and printed a deprecation warning upon its use. Use
845 ``pyramid.config`` instead.
846
b274d05 @mcdonc - The ``pyramid.paster.PyramidTemplate`` API was removed. It had been
mcdonc authored
847 - The ``pyramid.paster.PyramidTemplate`` API was removed. It had been
848 deprecated since Pyramid 1.1 and issued a warning on import. If your code
849 depended on this, adjust your code to import
850 ``pyramid.scaffolds.PyramidTemplate`` instead.
851
ef2e517 @mcdonc - The ``pyramid.settings.get_settings()`` API was removed. It had been
mcdonc authored
852 - The ``pyramid.settings.get_settings()`` API was removed. It had been
853 printing a deprecation warning since Pyramid 1.0. If your code depended on
854 this API, use ``pyramid.threadlocal.get_current_registry().settings``
855 instead or use the ``settings`` attribute of the registry available from
856 the request (``request.registry.settings``).
857
69e0aad @mcdonc - These APIs from the ``pyramid.testing`` module were removed. They …
mcdonc authored
858 - These APIs from the ``pyramid.testing`` module were removed. They have
859 been printing deprecation warnings since Pyramid 1.0:
860
861 * ``registerDummySecurityPolicy``, use
862 ``pyramid.config.Configurator.testing_securitypolicy`` instead.
863
864 * ``registerResources`` (aka ``registerModels``, use
865 ``pyramid.config.Configurator.testing_resources`` instead.
866
867 * ``registerEventListener``, use
868 ``pyramid.config.Configurator.testing_add_subscriber`` instead.
869
870 * ``registerTemplateRenderer`` (aka `registerDummyRenderer``), use
871 ``pyramid.config.Configurator.testing_add_template`` instead.
872
873 * ``registerView``, use ``pyramid.config.Configurator.add_view`` instead.
874
875 * ``registerUtility``, use
876 ``pyramid.config.Configurator.registry.registerUtility`` instead.
877
878 * ``registerAdapter``, use
879 ``pyramid.config.Configurator.registry.registerAdapter`` instead.
880
24c9326 @blaflamme added bug fix to changes
blaflamme authored
881 * ``registerSubscriber``, use
69e0aad @mcdonc - These APIs from the ``pyramid.testing`` module were removed. They …
mcdonc authored
882 ``pyramid.config.Configurator.add_subscriber`` instead.
883
24c9326 @blaflamme added bug fix to changes
blaflamme authored
884 * ``registerRoute``, use
69e0aad @mcdonc - These APIs from the ``pyramid.testing`` module were removed. They …
mcdonc authored
885 ``pyramid.config.Configurator.add_route`` instead.
886
24c9326 @blaflamme added bug fix to changes
blaflamme authored
887 * ``registerSettings``, use
69e0aad @mcdonc - These APIs from the ``pyramid.testing`` module were removed. They …
mcdonc authored
888 ``pyramid.config.Configurator.add_settings`` instead.
889
64452ed @mcdonc rename subrequest to invoke_subrequest
mcdonc authored
890 - In Pyramid 1.3 and previous, the ``__call__`` method of a Response object
891 was invoked before any finished callbacks were executed. As of this
892 release, the ``__call__`` method of a Response object is invoked *after*
893 finished callbacks are executed. This is in support of the
894 ``request.invoke_subrequest`` feature.
895
b72ba1a @mcdonc add upgrading chapter, make docs render again
mcdonc authored
896 Documentation
897 -------------
898
899 - Added an "Upgrading Pyramid" chapter to the narrative documentation. It
07cb8f0 @mcdonc add pyramid.decorator.reify as an API. Closes #682
mcdonc authored
900 describes how to cope with deprecations and removals of Pyramid APIs and
901 how to show Pyramid-generated deprecation warnings while running tests and
902 while running a server.
b72ba1a @mcdonc add upgrading chapter, make docs render again
mcdonc authored
903
37d2c22 @mcdonc docs and test
mcdonc authored
904 - Added a "Invoking a Subrequest" chapter to the documentation. It describes
64452ed @mcdonc rename subrequest to invoke_subrequest
mcdonc authored
905 how to use the new ``request.invoke_subrequest`` API.
37d2c22 @mcdonc docs and test
mcdonc authored
906
ebcdc7c @mcdonc - It is no longer possible to pass an environ dictionary directly to
mcdonc authored
907 Dependencies
908 ------------
909
910 - Pyramid now requires WebOb 1.2b3+ (the prior Pyramid release only relied on
911 1.2dev+). This is to ensure that we obtain a version of WebOb that returns
912 ``request.path_info`` as text.
913
Something went wrong with that request. Please try again.