diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-12-05 10:58:32 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-12-05 10:58:32 -0700 |
| commit | 99b3debff817c77b3fc7b95e3839eb8e935fab7a (patch) | |
| tree | 7ea7fa86433d2248e325cbf9a16a9252a772c71a | |
| parent | 2916ab3c7a2d876935bdbd286431ffdf0f23855d (diff) | |
| download | pyramid-99b3debff817c77b3fc7b95e3839eb8e935fab7a.tar.gz pyramid-99b3debff817c77b3fc7b95e3839eb8e935fab7a.tar.bz2 pyramid-99b3debff817c77b3fc7b95e3839eb8e935fab7a.zip | |
clarify class/interface precedence wrt view selection
| -rw-r--r-- | docs/narr/views.rst | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/narr/views.rst b/docs/narr/views.rst index c6a7f8b19..af40d4ac4 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -1767,11 +1767,13 @@ Any time a model that is determined to be the :term:`context` provides this interface, and a view named ``hello.html`` is looked up against it as per the URL, the ``mypackage.views.hello_world`` view callable will be invoked. -Note that views registered against a model class take precedence over views -registered for any interface the model class implements when an ambiguity -arises. If a view is registered for both the class type of the context and -an interface implemented by the context's class, the view registered for the -context's class will "win". +Note, in cases where a view is registered against a model class, and a +view is also registered against an interface that the model class +implements, an ambiguity arises. Views registered for the model class +take precedence over any views registered for any interface the model +class implements. Thus, if a view is registered for both the class type +of the context and an interface implemented by the context's class, the +view registered for the context's class will "win". For more information about defining models with interfaces for use within view configuration, see :ref:`models_which_implement_interfaces`. |
