Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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