diff options
| author | Chris McDonough <chrism@plope.com> | 2016-06-01 17:13:27 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2016-06-01 17:13:27 -0400 |
| commit | 3e9a737500e79a6a919ce53db9557c75d874b84c (patch) | |
| tree | ef674c176ab29b9dede8a8fa70c3a18a26edde44 /docs/designdefense.rst | |
| parent | b5f065906f75efdcc9f80d4f0b8b4092e92b41c0 (diff) | |
| parent | 382f93e2bfec5563587e306fda3fd34759314300 (diff) | |
| download | pyramid-3e9a737500e79a6a919ce53db9557c75d874b84c.tar.gz pyramid-3e9a737500e79a6a919ce53db9557c75d874b84c.tar.bz2 pyramid-3e9a737500e79a6a919ce53db9557c75d874b84c.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/designdefense.rst')
| -rw-r--r-- | docs/designdefense.rst | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 5f3295305..f42582e47 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -131,7 +131,7 @@ obvious. First, what's a "utility"? Well, for the purposes of this discussion, and for the purpose of the code above, it's just not very important. If you really want to know, you can read `this -<http://www.muthukadan.net/docs/zca.html#utility>`_. However, still, readers +<http://muthukadan.net/docs/zca.html#utility>`_. However, still, readers of such code need to understand the concept in order to parse it. This is problem number one. @@ -608,7 +608,7 @@ pyramid/scaffolds/ 133KB -pyramid/ (except for ``pyramd/tests`` and ``pyramid/scaffolds``) +pyramid/ (except for ``pyramid/tests`` and ``pyramid/scaffolds``) 812KB @@ -665,7 +665,7 @@ desktop GUI platforms by using similar terminology, and to provide some frame of reference for how various components in the common web framework might hang together. But in the opinion of the author, "MVC" doesn't match the web very well in general. Quoting from the `Model-View-Controller Wikipedia entry -<http://en.wikipedia.org/wiki/Model–view–controller>`_: +<https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller>`_: Though MVC comes in different flavors, control flow is generally as follows: @@ -847,9 +847,9 @@ Challenge +++++++++ :app:`Pyramid` performs automatic authorization checks only at :term:`view` -execution time. Zope 3 wraps context objects with a `security proxy -<http://wiki.zope.org/zope3/WhatAreSecurityProxies>`_, which causes Zope 3 also -to do security checks during attribute access. I like this, because it means: +execution time. Zope 3 wraps context objects with a security proxy, which +causes Zope 3 also to do security checks during attribute access. I like this, +because it means: #) When I use the security proxy machinery, I can have a view that conditionally displays certain HTML elements (like form fields) or @@ -1006,16 +1006,18 @@ the following: Microframeworks have smaller Hello World programs ------------------------------------------------- -Self-described "microframeworks" exist. `Bottle <http://bottle.paws.de>`_ and -`Flask <http://flask.pocoo.org/>`_ are two that are becoming popular. `Bobo -<http://bobo.digicool.com/>`_ doesn't describe itself as a microframework, but -its intended user base is much the same. Many others exist. We've even (only as -a teaching tool, not as any sort of official project) `created one using -Pyramid <http://static.repoze.org/casts/videotags.html>`_. The videos use BFG, -a precursor to Pyramid, but the resulting code is `available for Pyramid too -<https://github.com/Pylons/groundhog>`_). Microframeworks are small frameworks -with one common feature: each allows its users to create a fully functional -application that lives in a single Python file. +Self-described "microframeworks" exist. `Bottle +<http://bottlepy.org/docs/dev/index.html>`_ and `Flask +<http://flask.pocoo.org/>`_ are two that are becoming popular. `Bobo +<http://bobo.digicool.com/en/latest/>`_ doesn't describe itself as a +microframework, but its intended user base is much the same. Many others exist. +We've even (only as a teaching tool, not as any sort of official project) +`created one using Pyramid <http://static.repoze.org/casts/videotags.html>`_. +The videos use BFG, a precursor to Pyramid, but the resulting code is +`available for Pyramid too <https://github.com/Pylons/groundhog>`_). +Microframeworks are small frameworks with one common feature: each allows its +users to create a fully functional application that lives in a single Python +file. Some developers and microframework authors point out that Pyramid's "hello world" single-file program is longer (by about five lines) than the equivalent @@ -1295,12 +1297,12 @@ Consider the following simple `Groundhog from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/admin') + @app.route('/admin') def admin(): return '<html>admin page</html>' - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return '<html>add</html>' if action == 'delete': @@ -1320,15 +1322,15 @@ order of the function definitions in the file? from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return '<html>add</html>' if action == 'delete': return '<html>delete</html>' return app.abort(404) - app.route('/admin') + @app.route('/admin') def admin(): return '<html>admin page</html>' @@ -1430,9 +1432,10 @@ object which *is not logically global*: # this is executed if the request method was GET or the # credentials were invalid -The `Pylons 1.X <http://pylonsproject.org>`_ web framework uses a similar -strategy. It calls these things "Stacked Object Proxies", so, for purposes -of this discussion, I'll do so as well. +The `Pylons 1.X +<http://docs.pylonsproject.org/projects/pylons-webframework/en/latest/>`_ +web framework uses a similar strategy. It calls these things "Stacked Object +Proxies", so, for purposes of this discussion, I'll do so as well. Import statements in Python (``import foo``, ``from bar import baz``) are most frequently performed to obtain a reference to an object defined globally @@ -1650,10 +1653,11 @@ If you can understand this hello world program, you can use Pyramid: server = make_server('0.0.0.0', 8080, app) server.serve_forever() -Pyramid has ~ 700 pages of documentation (printed), covering topics from the -very basic to the most advanced. *Nothing* is left undocumented, quite +Pyramid has over 1200 pages of documentation (printed), covering topics from +the very basic to the most advanced. *Nothing* is left undocumented, quite literally. It also has an *awesome*, very helpful community. Visit the -#pyramid IRC channel on freenode.net (irc://freenode.net#pyramid) and see. +`#pyramid IRC channel on freenode.net +<https://webchat.freenode.net/?channels=pyramid>`_ and see. Hate Zope +++++++++ @@ -1701,5 +1705,6 @@ Other Challenges ---------------- Other challenges are encouraged to be sent to the `Pylons-devel -<http://groups.google.com/group/pylons-devel>`_ maillist. We'll try to address -them by considering a design change, or at very least via exposition here. +<https://groups.google.com/forum/#!forum/pylons-devel>`_ maillist. We'll try +to address them by considering a design change, or at very least via exposition +here. |
