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