forked from Pylons/pyramid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGES.txt
425 lines (306 loc) · 16.3 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
Next release
============
Features
--------
- Add logging configuration to all paster templates.
- ``pyramid_alchemy``, ``pyramid_routesalchemy``, and ``pylons_sqla`` paster
templates now use idiomatic SQLAlchemy configuration in their respective
``.ini`` files and Python code.
- ``pyramid.testing.DummyRequest`` now has a class variable,
``query_string``, which defaults to the empty string.
- Add support for json on GAE by catching NotImplementedError and importing
simplejson from django.utils.
- The Mako renderer now accepts a resource specification for
``mako.module_directory``.
- New boolean Mako settings variable ``mako.strict_undefined``. See `Mako
Context Variables
<http://www.makotemplates.org/docs/runtime.html#context-variables>`_ for
its meaning.
Dependencies
------------
- Depend on Mako 0.3.6+ (we now require the ``strict_undefined`` feature).
Bug Fixes
---------
- The ``pyramid_routesalchemy`` paster template's unit tests failed
(``AssertionError: 'SomeProject' != 'someproject'``). This is fixed.
- Make default renderer work (renderer factory registered with no name, which
is active for every view unless the view names a specific renderer).
- The Mako renderer did not properly turn the ``mako.imports``,
``mako.default_filters``, and ``mako.imports`` settings into lists.
- The Mako renderer did not properly convert the ``mako.error_handler``
setting from a dotted name to a callable.
Documentation
-------------
- "Sample Applications" section of docs changed to note existence of Cluegun,
Shootout and Virginia sample applications, ported from their repoze.bfg
origin packages.
- SQLAlchemy+URLDispatch tutorial updated to integrate changes to
``pyramid_routesalchemy`` template.
- Add ``pyramid.interfaces.ITemplateRenderer`` interface to Interfaces API
chapter (has ``implementation()`` method, required to be used when getting
at Chameleon macros).
- Add a "Modifying Package Structure" section to the project narrative
documentation chapter (explain turning a module into a package).
1.0a4 (2010-11-21)
==================
Features
--------
- URL Dispatch now allows for replacement markers to be located anywhere
in the pattern, instead of immediately following a ``/``.
- URL Dispatch now uses the form ``{marker}`` to denote a replace marker in
the route pattern instead of ``:marker``. The old colon-style marker syntax
is still accepted for backwards compatibility. The new format allows a
regular expression for that marker location to be used instead of the
default ``[^/]+``, for example ``{marker:\d+}`` is now valid to require the
marker to be digits.
- Add a ``pyramid.url.route_path`` API, allowing folks to generate relative
URLs. Calling ``route_path`` is the same as calling
``pyramid.url.route_url`` with the argument ``_app_url`` equal to the empty
string.
- Add a ``pyramid.request.Request.route_path`` API. This is a convenience
method of the request which calls ``pyramid.url.route_url``.
- Make test suite pass on Jython (requires PasteScript trunk, presumably to
be 1.7.4).
- Make test suite pass on PyPy (Chameleon doesn't work).
- Surrounding application configuration with ``config.begin()`` and
``config.end()`` is no longer necessary. All paster templates have been
changed to no longer call these functions.
- Fix configurator to not convert ``ImportError`` to ``ConfigurationError``
if the import that failed was unrelated to the import requested via a
dotted name when resolving dotted names (such as view dotted names).
Documentation
-------------
- SQLAlchemy+URLDispatch and ZODB+Traversal tutorials have been updated to
not call ``config.begin()`` or ``config.end()``.
Bug Fixes
---------
- Add deprecation warnings to import of ``pyramid.chameleon_text`` and
``pyramid.chameleon_zpt`` of ``get_renderer``, ``get_template``,
``render_template``, and ``render_template_to_response``.
- Add deprecation warning for import of ``pyramid.zcml.zcml_configure`` and
``pyramid.zcml.file_configure``.
- The ``pyramid_alchemy`` paster template had a typo, preventing an import
from working.
- Fix apparent failures when calling ``pyramid.traversal.find_model(root,
path)`` or ``pyramid.traversal.traverse(path)`` when ``path`` is
(erroneously) a Unicode object. The user is meant to pass these APIs a
string object, never a Unicode object. In practice, however, users indeed
pass Unicode. Because the string that is passed must be ASCII encodeable,
now, if they pass a Unicode object, its data is eagerly converted to an
ASCII string rather than being passed along to downstream code as a
convenience to the user and to prevent puzzling second-order failures from
cropping up (all failures will occur within ``pyramid.traversal.traverse``
rather than later down the line as the result of calling e.g.
``traversal_path``).
Backwards Incompatibilities
---------------------------
- The ``pyramid.testing.zcml_configure`` API has been removed. It had been
advertised as removed since repoze.bfg 1.2a1, but hadn't actually been.
Deprecations
------------
- The ``pyramid.settings.get_settings`` API is now deprecated. Use
``pyramid.threadlocals.get_current_registry().settings`` instead or use the
``settings`` attribute of the registry available from the request
(``request.registry.settings``).
Documentation
-------------
- Removed ``zodbsessions`` tutorial chapter. It's still useful, but we now
have a SessionFactory abstraction which competes with it, and maintaining
documentation on both ways to do it is a distraction.
Internal
--------
- Replace Twill with WebTest in internal integration tests (avoid deprecation
warnings generated by Twill).
1.0a3 (2010-11-16)
==================
Features
--------
- Added Mako TemplateLookup settings for ``mako.error_handler``,
``mako.default_filters``, and ``mako.imports``.
- Normalized all paster templates: each now uses the name ``main`` to
represent the function that returns a WSGI application, each now uses
WebError, each now has roughly the same shape of development.ini style.
- Added class vars ``matchdict`` and ``matched_route`` to
``pyramid.request.Request``. Each is set to ``None``.
- New API method: ``pyramid.settings.asbool``.
- New API methods for ``pyramid.request.Request``: ``model_url``,
``route_url``, and ``static_url``. These are simple passthroughs for their
respective functions in ``pyramid.url``.
- The ``settings`` object which used to be available only when
``request.settings.get_settings`` was called is now available as
``registry.settings`` (e.g. ``request.registry.settings`` in view code).
Bug Fixes
---------
- The pylons_* paster templates erroneously used the ``{squiggly}`` routing
syntax as the pattern supplied to ``add_route``. This style of routing is
not supported. They were replaced with ``:colon`` style route patterns.
- The pylons_* paster template used the same string
(``your_app_secret_string``) for the ``session.secret`` setting in the
generated ``development.ini``. This was a security risk if left unchanged
in a project that used one of the templates to produce production
applications. It now uses a randomly generated string.
Documentation
-------------
- ZODB+traversal wiki (``wiki``) tutorial updated due to changes to
``pyramid_zodb`` paster template.
- SQLAlchemy+urldispach wiki (``wiki2``) tutorial updated due to changes to
``pyramid_routesalchemy`` paster template.
- Documented the ``matchdict`` and ``matched_route`` attributes of the
request object in the Request API documentation.
Deprecations
------------
- Obtaining the ``settings`` object via
``registry.{get|query}Utility(ISettings)`` is now deprecated. Instead,
obtain the ``settings`` object via the ``registry.settings`` attribute. A
backwards compatibility shim was added to the registry object to register
the settings object as an ISettings utility when ``setattr(registry,
'settings', foo)`` is called, but it will be removed in a later release.
- Obtaining the ``settings`` object via ``pyramid.settings.get_settings`` is
now deprecated. Obtain it as the ``settings`` attribute of the registry
now (obtain the registry via ``pyramid.threadlocal.get_registry`` or as
``request.registry``).
Behavior Differences
--------------------
- Internal: ZCML directives no longer call get_current_registry() if there's
a ``registry`` attribute on the ZCML context (kill off use of
threadlocals).
- Internal: Chameleon template renderers now accept two arguments: ``path``
and ``lookup``. ``Lookup`` will be an instance of a lookup class which
supplies (late-bound) arguments for debug, reload, and translate. Any
third-party renderers which use (the non-API) function
``pyramid.renderers.template_renderer_factory`` will need to adjust their
implementations to obey the new callback argument list. This change was to
kill off inappropriate use of threadlocals.
1.0a2 (2010-11-09)
==================
Documentation
-------------
- All references to events by interface
(e.g. ``pyramid.interfaces.INewRequest``) have been changed to reference
their concrete classes (e.g. ``pyramid.events.NewRequest``) in
documentation about making subscriptions.
- All references to Pyramid-the-application were changed from mod-`pyramid`
to app-`Pyramid`. A custom role setting was added to ``docs/conf.py`` to
allow for this. (internal)
1.0a1 (2010-11-05)
==================
Features (delta from BFG 1.3)
-------------------------------
- Mako templating renderer supports resource specification format for
template lookups and within Mako templates. Absolute filenames must
be used in Pyramid to avoid this lookup process.
- Add ``pyramid.httpexceptions`` module, which is a facade for the
``webob.exc`` module.
- Direct built-in support for the Mako templating language.
- A new configurator method exists: ``add_handler``. This method adds
a Pylons-style "view handler" (such a thing used to be called a
"controller" in Pylons 1.0).
- New argument to configurator: ``session_factory``.
- New method on configurator: ``set_session_factory``
- Using ``request.session`` now returns a (dictionary-like) session
object if a session factory has been configured.
- The request now has a new attribute: ``tmpl_context`` for benefit of
Pylons users.
- The decorator previously known as ``pyramid.view.bfg_view`` is now
known most formally as ``pyramid.view.view_config`` in docs and
paster templates. An import of ``pyramid.view.bfg_view``, however,
will continue to work "forever".
- New API methods in ``pyramid.session``: ``signed_serialize`` and
``signed_deserialize``.
- New interface: ``pyramid.interfaces.IRendererInfo``. An object of this type
is passed to renderer factory constructors (see "Backwards
Incompatibilities").
- New event type: ``pyramid.interfaces.IBeforeRender``. An object of this type
is sent as an event before a renderer is invoked (but after the
application-level renderer globals factory added via
``pyramid.configurator.configuration.set_renderer_globals_factory``, if any,
has injected its own keys). Applications may now subscribe to the
``IBeforeRender`` event type in order to introspect the and modify the set of
renderer globals before they are passed to a renderer. The event object
iself has a dictionary-like interface that can be used for this purpose. For
example::
from repoze.events import subscriber
from pyramid.interfaces import IRendererGlobalsEvent
@subscriber(IRendererGlobalsEvent)
def add_global(event):
event['mykey'] = 'foo'
If a subscriber attempts to add a key that already exist in the renderer
globals dictionary, a ``KeyError`` is raised. This limitation is due to the
fact that subscribers cannot be ordered relative to each other. The set of
keys added to the renderer globals dictionary by all subscribers and
app-level globals factories must be unique.
- New class: ``pyramid.response.Response``. This is a pure facade for
``webob.Response`` (old code need not change to use this facade, it's
existence is mostly for vanity and documentation-generation purposes).
- All preexisting paster templates (except ``zodb``) now use "imperative"
configuration (``starter``, ``routesalchemy``, ``alchemy``).
- A new paster template named ``pyramid_starter_zcml`` exists, which uses
declarative configuration.
Documentation (delta from BFG 1.3)
-----------------------------------
- Added a ``pyramid.httpexceptions`` API documentation chapter.
- Added a ``pyramid.session`` API documentation chapter.
- Added a ``Session Objects`` narrative documentation chapter.
- Added an API chapter for the ``pyramid.personality`` module.
- Added an API chapter for the ``pyramid.response`` module.
- All documentation which previously referred to ``webob.Response`` now uses
``pyramid.response.Response`` instead.
- The documentation has been overhauled to use imperative configuration,
moving declarative configuration (ZCML) explanations to a separate
narrative chapter ``declarative.rst``.
- The ZODB Wiki tutorial was updated to take into account changes to the
``pyramid_zodb`` paster template.
- The SQL Wiki tutorial was updated to take into account changes to the
``pyramid_routesalchemy`` paster template.
Backwards Incompatibilities (with BFG 1.3)
------------------------------------------
- There is no longer an ``IDebugLogger`` registered as a named utility
with the name ``repoze.bfg.debug``.
- The logger which used to have the name of ``repoze.bfg.debug`` now
has the name ``pyramid.debug``.
- The deprecated API ``pyramid.testing.registerViewPermission``
has been removed.
- The deprecated API named ``pyramid.testing.registerRoutesMapper``
has been removed.
- The deprecated API named ``pyramid.request.get_request`` was removed.
- The deprecated API named ``pyramid.security.Unauthorized`` was
removed.
- The deprecated API named ``pyramid.view.view_execution_permitted``
was removed.
- The deprecated API named ``pyramid.view.NotFound`` was removed.
- The ``bfgshell`` paster command is now named ``pshell``.
- The Venusian "category" for all built-in Venusian decorators
(e.g. ``subscriber`` and ``view_config``/``bfg_view``) is now
``pyramid`` instead of ``bfg``.
- ``pyramid.renderers.rendered_response`` function removed; use
``render_pyramid.renderers.render_to_response`` instead.
- Renderer factories now accept a *renderer info object* rather than an
absolute resource specification or an absolute path. The object has the
following attributes: ``name`` (the ``renderer=`` value), ``package`` (the
'current package' when the renderer configuration statement was found),
``type``: the renderer type, ``registry``: the current registry, and
``settings``: the deployment settings dictionary.
Third-party ``repoze.bfg`` renderer implementations that must be ported to
Pyramid will need to account for this.
This change was made primarily to support more flexible Mako template
rendering.
- The presence of the key ``repoze.bfg.message`` in the WSGI environment when
an exception occurs is now deprecated. Instead, code which relies on this
environ value should use the ``exception`` attribute of the request
(e.g. ``request.exception[0]``) to retrieve the message.
- The values ``bfg_localizer`` and ``bfg_locale_name`` kept on the request
during internationalization for caching purposes were never APIs. These
however have changed to ``localizer`` and ``locale_name``, respectively.
- The default ``cookie_name`` value of the ``authtktauthenticationpolicy`` ZCML
now defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
- The default ``cookie_name`` value of the
``pyramid.authentication.AuthTktAuthenticationPolicy`` constructor now
defaults to ``auth_tkt`` (it used to default to ``repoze.bfg.auth_tkt``).
- The ``request_type`` argument to the ``view`` ZCML directive, the
``pyramid.configuration.Configurator.add_view`` method, or the
``pyramid.view.view_config`` decorator (nee ``bfg_view``) is no longer
permitted to be one of the strings ``GET``, ``HEAD``, ``PUT``, ``POST`` or
``DELETE``, and now must always be an interface. Accepting the
method-strings as ``request_type`` was a backwards compatibility strategy
servicing repoze.bfg 1.0 applications. Use the ``request_method``
parameter instead to specify that a view a string request-method predicate.