Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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