Steve Piercy
2017-06-27 7eeb5598717ec7f1523643ef9ef5a0c35847040f
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
a2680f 50 - Add better docs about what-to-do-when-behind-a-proxy: rutter ("/foo =
a7d50d 51   app1" and "domain app1.localhost = app1"), ProxyPreserveHost and the nginx
a2680f 52   proxy_params, preserving HTTPS URLs.
371a67 53
6aafc5 54 - Debug option to print view matching decision (e.g. debug_viewlookup or so).
94a527 55
f765a6 56 - Non-bwcompat use of threadlocals that need to be documented or ameliorated:
CM 57
58   security.principals_allowed_by_permission
59
60   resource.OverrideProvider._get_overrides: can't credibly be removed,
61   because it stores an overrideprovider as a module-scope global.
62
63   traversal.traverse: this API is a stepchild, and needs to be changed.
64
65   Configurator.add_translation_dirs: not passed any context but a message,
66   can't credibly be removed.
67
95eab9 68 - Deprecate pyramid.security.view_execution_permitted (it only works for
CM 69   traversal).
f07765 70
7c1549 71 - Provide a ``has_view`` function.
CM 72
485ef6 73 - Update App engine chapter with less creaky directions.
d8d14a 74
9ff3b2 75 - Idea from Zart:
CM 76
77   diff --git a/pyramid/paster.py b/pyramid/paster.py
78   index b0e4d79..b3bd82a 100644
79   --- a/pyramid/paster.py
80   +++ b/pyramid/paster.py
81   @@ -8,6 +8,7 @@ from paste.deploy import (
82    from pyramid.compat import configparser
83    from logging.config import fileConfig
84    from pyramid.scripting import prepare
85   +from pyramid.config import Configurator
86    
87    def get_app(config_uri, name=None, loadapp=loadapp):
88        """ Return the WSGI application named ``name`` in the PasteDeploy
89   @@ -111,3 +112,10 @@ def bootstrap(config_uri, request=None):
90        env['app'] = app
91        return env
92    
93   +def make_pyramid_app(global_conf, app=None, **settings):
94   +    """Return pyramid application configured with provided settings"""
95   +    config = Configurator(package='pyramid', settings=settings)
96   +    if app:
97   +        config.include(app)
98   +    app = config.make_wsgi_app()
99   +    return app
100   diff --git a/setup.py b/setup.py
101   index 03ebb42..91e0e21 100644
102   --- a/setup.py
103   +++ b/setup.py
104   @@ -118,6 +118,8 @@ setup(name='pyramid',
105            [paste.server_runner]
106            wsgiref = pyramid.scripts.pserve:wsgiref_server_runner
107            cherrypy = pyramid.scripts.pserve:cherrypy_server_runner
108   +        [paster.app_factory]
109   +        main = pyramid.paster:make_pyramid_app
110          """
111          )
112  
113
cccc91 114 Future
CM 115 ------
116
72b93f 117 - 1.6: turn ``pyramid.settings.Settings`` into a function that returns the
CM 118   original dict (after ``__getattr__`` deprecation period, it was deprecated
119   in 1.2).
f272f2 120
63c969 121 - 1.6: Remove IContextURL and TraversalContextURL.
CM 122
6beffc 123 - 1.8: Remove set_request_property.
886378 124 - 1.8: Drop Python 3.3 support.
6beffc 125
MM 126 - 1.9: Remove extra code enabling ``pyramid.security.remember(principal=...)``
127   and force use of ``userid``.
ebf457 128
d8d14a 129 Probably Bad Ideas
CM 130 ------------------
d89aee 131
485ef6 132 - Add functionality that mocks the behavior of ``repoze.browserid``.
c8e78c 133
5f3fc0 134 - Consider implementing the API outlined in
CM 135   http://plope.com/pyramid_auth_design_api_postmortem, phasing out the
136   current auth-n-auth abstractions in a backwards compatible way.
9d3bd8 137
d8d14a 138 - Maybe add ``add_renderer_globals`` method to Configurator.
CM 139
95eab9 140 - Supply ``X-Vhm-Host`` support (probably better to do what paste#prefix
CM 141   middleware does).
142
c5724c 143 - Have ``remember`` and ``forget`` actually set headers on the response using
CM 144   a response callback (and return the empty list)?
f8636c 145
CM 146 - http://pythonguy.wordpress.com/2011/06/22/dynamic-variables-revisited/
147   instead of thread locals
a0547e 148
CM 149 - Context manager for creating a new configurator (replacing
150   ``with_package``).  E.g.::
151
152     with config.partial(package='bar') as c:
153         c.add_view(...)
154
155   or::
156
157     with config.partial(introspection=False) as c:
158         c.add_view(..)
159
44d73a 160 - _fix_registry should dictify the registry being fixed.
20b1a1 161
a2680f 162 - Apply a prefix to the userid principal to avoid poisoning the principal
MM 163   namespace. See https://github.com/Pylons/pyramid/issues/2060