diff options
| author | Chris McDonough <chrism@plope.com> | 2011-12-03 16:24:34 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-12-03 16:24:34 -0500 |
| commit | 5224059f71d0ad592a611c196a3af7cbd1dc828f (patch) | |
| tree | 636c2c2b0613d8350629e1a85a43f1b1ccf05e41 /docs/narr/extconfig.rst | |
| parent | 9d97b654057e621c4928fe597053d54aa5f63a8c (diff) | |
| download | pyramid-5224059f71d0ad592a611c196a3af7cbd1dc828f.tar.gz pyramid-5224059f71d0ad592a611c196a3af7cbd1dc828f.tar.bz2 pyramid-5224059f71d0ad592a611c196a3af7cbd1dc828f.zip | |
add more content to the introspectables narr chapter; adjust introspection registrations while doing so
Diffstat (limited to 'docs/narr/extconfig.rst')
| -rw-r--r-- | docs/narr/extconfig.rst | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/docs/narr/extconfig.rst b/docs/narr/extconfig.rst index ac8b83baa..856654377 100644 --- a/docs/narr/extconfig.rst +++ b/docs/narr/extconfig.rst @@ -336,7 +336,7 @@ Two introspectables may have relationships between each other. config = Configurator() config.add_directive('add_jammyjam', add_jammyjam) -In the above example, the ``add_jammyjam`` directive registers *two* +In the above example, the ``add_jammyjam`` directive registers two introspectables. The first is related to the ``value`` passed to the directive; the second is related to the ``template`` passed to the directive. If you believe a concept within a directive is important enough to have its @@ -352,8 +352,15 @@ introspectable and the ``tmpl_intr`` introspectable; the arguments passed to ``relate`` are the category name and discriminator of the ``tmpl_intr`` introspectable. +Relationships need not be made between two introspectables created by the +same directive. Instead, a relationship can be formed between an +introspectable created in one directive and another introspectable created in +another by calling ``relate`` on either side with the other directive's +category name and discriminator. An error will be raised at configuration +commit time if you attempt to relate an introspectable with another +nonexistent introspectable, however. + Introspectable relationships will show up in frontend system renderings of introspection values. For example, if a view registration names a route name, the introspectable related to the view callable will show a reference -to the route it relates to and vice versa. - +to the route to which it relates to and vice versa. |
