Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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