From dc06b0b30c0508835022567cee40196d6d9cb984 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 16 Dec 2010 19:03:00 -0500 Subject: - 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``. --- docs/narr/project.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'docs') 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 + >>> registry + + >>> 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 `_ installed in the interpreter you use to invoke the ``paster`` command, -- cgit v1.2.3