diff options
| author | Chris McDonough <chrism@plope.com> | 2010-12-16 19:03:00 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-12-16 19:03:00 -0500 |
| commit | dc06b0b30c0508835022567cee40196d6d9cb984 (patch) | |
| tree | 9f99b112874f3d42f2cb304fdadea666ce766a1b /docs | |
| parent | a6a1508632a93f6c41e3d61007d5a3d891188bb6 (diff) | |
| download | pyramid-dc06b0b30c0508835022567cee40196d6d9cb984.tar.gz pyramid-dc06b0b30c0508835022567cee40196d6d9cb984.tar.bz2 pyramid-dc06b0b30c0508835022567cee40196d6d9cb984.zip | |
- The name ``registry`` is now available in a ``pshell`` environment by
default. It is the application registry object.
- Changed "Project" chapter slightly to expand on use of ``paster pshell``.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/project.rst | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/narr/project.rst b/docs/narr/project.rst index f8a9017db..2b03f7373 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -287,9 +287,24 @@ the name ``MyProject`` as a section name: [chrism@vitaminf shellenv]$ ../bin/paster pshell development.ini MyProject Python 2.4.5 (#1, Aug 29 2008, 12:27:37) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin - Type "help" for more information. "root" is the Pyramid app root object. + Type "help" for more information. "root" is the Pyramid app root object, + "registry" is the Pyramid registry object. >>> root <myproject.models.MyModel object at 0x445270> + >>> registry + <Registry myproject> + >>> registry.settings['debug_notfound'] + False + >>> from myproject.views import my_view + >>> from pyramid.request import Request + >>> r = Request.blank('/') + >>> my_view(r) + {'project': 'myproject'} + +Two names are made available to the pshell user as globals: ``root`` and +``registry``. ``root`` is the the object returned by the default :term:`root +factory` in your application. ``registry`` is the :term:`application +registry` object (often accessed within view code as ``request.registry``). If you have `IPython <http://en.wikipedia.org/wiki/IPython>`_ installed in the interpreter you use to invoke the ``paster`` command, |
