Steve Piercy
2016-05-08 41ba29ecb853d87c9c6c75fc7887872b13d1abc5
commit | author | age
051143 1 Pyramid TODOs
CM 2 =============
69364d 3
8ac9e6 4 Nice-to-Have
CM 5 ------------
0db4a1 6
bc5272 7 - config.set_registry_attr with conflict detection... make sure the attr is
CM 8   added before a commit, but register an action so a conflict can be detected.
9
2861f1 10 - Provide the presumed renderer name to the called view as an attribute of
CM 11   the request.
12
d806f9 13 - Have action methods return their discriminators.
CM 14
37f3ba 15 - Modify view mapper narrative docs to not use pyramid_handlers.
8ac9e6 16
cd422c 17 - Modify the urldispatch chapter examples to assume a scan rather than
CM 18   ``add_view``.
19
8ac9e6 20 - Introspection:
57a0d7 21
63c969 22   * ``default root factory`` category (prevent folks from needing to searh
CM 23     "root factories" category)?
58c01f 24
63c969 25   * ``default view mapper`` category (prevent folks from needing to search
CM 26     "view mappers" category)?
58c01f 27
4a4ef4 28   * get rid of "tweens" category (can't sort properly?)
CM 29
bfc01f 30 - Fix deployment recipes in cookbook (discourage proxying without changing
CM 31   server).
32
773024 33 - Try "with transaction.manager" in an exception view with SQLA (preempt
CM 34   homina homina response about how to write "to the database" from within in
63c969 35   an exception view).  Note: tried this and couldn't formulate the right
CM 36   situation where the database could not be written to within an exception
37   view (but didn't try exhaustively).
e307fc 38
95eab9 39 - Add narrative docs for wsgiapp and wsgiapp2.
CM 40
41 - Basic WSGI documentation (pipeline / app / server).
42
63c969 43 - Change docs about creating a venusian decorator to not use ZCA (use
CM 44   configurator methods instead).
95eab9 45
CM 46 - Try to better explain the relationship between a renderer and a template in
47   the templates chapter and elsewhere.  Scan the documentation for reference
48   to a renderer as *only* view configuration (it's a larger concept now).
3d338e 49
a7d50d 50 - Add better docs about what-to-do-when-behind-a-proxy: paste.urlmap ("/foo =
CM 51   app1" and "domain app1.localhost = app1"), ProxyPreserveHost and the nginx
52   equivalent, preserving HTTPS URLs.
53
b5ffe3 54 - Alias the stupid long default session factory name.
371a67 55
6aafc5 56 - Debug option to print view matching decision (e.g. debug_viewlookup or so).
94a527 57
f765a6 58 - Non-bwcompat use of threadlocals that need to be documented or ameliorated:
CM 59
60   security.principals_allowed_by_permission
61
62   resource.OverrideProvider._get_overrides: can't credibly be removed,
63   because it stores an overrideprovider as a module-scope global.
64
65   traversal.traverse: this API is a stepchild, and needs to be changed.
66
67   Configurator.add_translation_dirs: not passed any context but a message,
68   can't credibly be removed.
69
95eab9 70 - Deprecate pyramid.security.view_execution_permitted (it only works for
CM 71   traversal).
f07765 72
7c1549 73 - Provide a ``has_view`` function.
CM 74
485ef6 75 - Update App engine chapter with less creaky directions.
d8d14a 76
9ff3b2 77 - Idea from Zart:
CM 78
79   diff --git a/pyramid/paster.py b/pyramid/paster.py
80   index b0e4d79..b3bd82a 100644
81   --- a/pyramid/paster.py
82   +++ b/pyramid/paster.py
83   @@ -8,6 +8,7 @@ from paste.deploy import (
84    from pyramid.compat import configparser
85    from logging.config import fileConfig
86    from pyramid.scripting import prepare
87   +from pyramid.config import Configurator
88    
89    def get_app(config_uri, name=None, loadapp=loadapp):
90        """ Return the WSGI application named ``name`` in the PasteDeploy
91   @@ -111,3 +112,10 @@ def bootstrap(config_uri, request=None):
92        env['app'] = app
93        return env
94    
95   +def make_pyramid_app(global_conf, app=None, **settings):
96   +    """Return pyramid application configured with provided settings"""
97   +    config = Configurator(package='pyramid', settings=settings)
98   +    if app:
99   +        config.include(app)
100   +    app = config.make_wsgi_app()
101   +    return app
102   diff --git a/setup.py b/setup.py
103   index 03ebb42..91e0e21 100644
104   --- a/setup.py
105   +++ b/setup.py
106   @@ -118,6 +118,8 @@ setup(name='pyramid',
107            [paste.server_runner]
108            wsgiref = pyramid.scripts.pserve:wsgiref_server_runner
109            cherrypy = pyramid.scripts.pserve:cherrypy_server_runner
110   +        [paster.app_factory]
111   +        main = pyramid.paster:make_pyramid_app
112          """
113          )
114  
115
cccc91 116 Future
CM 117 ------
118
72b93f 119 - 1.6: turn ``pyramid.settings.Settings`` into a function that returns the
CM 120   original dict (after ``__getattr__`` deprecation period, it was deprecated
121   in 1.2).
f272f2 122
63c969 123 - 1.6: Remove IContextURL and TraversalContextURL.
CM 124
ca3df8 125 - 1.7: Change ``pyramid.authentication.AuthTktAuthenticationPolicy`` default
MM 126   ``hashalg`` to ``sha512``.
127
ebf457 128 - 1.8 Remove set_request_property.
CM 129
d8d14a 130 Probably Bad Ideas
CM 131 ------------------
d89aee 132
485ef6 133 - Add functionality that mocks the behavior of ``repoze.browserid``.
c8e78c 134
5f3fc0 135 - Consider implementing the API outlined in
CM 136   http://plope.com/pyramid_auth_design_api_postmortem, phasing out the
137   current auth-n-auth abstractions in a backwards compatible way.
9d3bd8 138
d8d14a 139 - Maybe add ``add_renderer_globals`` method to Configurator.
CM 140
95eab9 141 - Supply ``X-Vhm-Host`` support (probably better to do what paste#prefix
CM 142   middleware does).
143
c5724c 144 - Have ``remember`` and ``forget`` actually set headers on the response using
CM 145   a response callback (and return the empty list)?
f8636c 146
CM 147 - http://pythonguy.wordpress.com/2011/06/22/dynamic-variables-revisited/
148   instead of thread locals
a0547e 149
CM 150 - Context manager for creating a new configurator (replacing
151   ``with_package``).  E.g.::
152
153     with config.partial(package='bar') as c:
154         c.add_view(...)
155
156   or::
157
158     with config.partial(introspection=False) as c:
159         c.add_view(..)
160
44d73a 161 - _fix_registry should dictify the registry being fixed.
20b1a1 162