summaryrefslogtreecommitdiff
path: root/docs/zcml
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-12-18 15:53:49 -0500
committerChris McDonough <chrism@plope.com>2010-12-18 15:53:49 -0500
commit738a2b5f3eb44da7036a31005144e5252827ac38 (patch)
tree80e10d2ae215b2e0e1f248354b6c9a5e11406cd5 /docs/zcml
parentaa6c4267b330a5665dcb7c98d75fe21f8eeececb (diff)
parent70119302324e5bf5627344f90c62ef31b6e43005 (diff)
downloadpyramid-738a2b5f3eb44da7036a31005144e5252827ac38.tar.gz
pyramid-738a2b5f3eb44da7036a31005144e5252827ac38.tar.bz2
pyramid-738a2b5f3eb44da7036a31005144e5252827ac38.zip
Merge branch 'model2resource'
Conflicts: docs/narr/views.rst
Diffstat (limited to 'docs/zcml')
-rw-r--r--docs/zcml/aclauthorizationpolicy.rst2
-rw-r--r--docs/zcml/asset.rst (renamed from docs/zcml/resource.rst)33
-rw-r--r--docs/zcml/forbidden.rst2
-rw-r--r--docs/zcml/handler.rst2
-rw-r--r--docs/zcml/notfound.rst2
-rw-r--r--docs/zcml/route.rst4
-rw-r--r--docs/zcml/view.rst12
7 files changed, 30 insertions, 27 deletions
diff --git a/docs/zcml/aclauthorizationpolicy.rst b/docs/zcml/aclauthorizationpolicy.rst
index 2c66da0c8..f09531415 100644
--- a/docs/zcml/aclauthorizationpolicy.rst
+++ b/docs/zcml/aclauthorizationpolicy.rst
@@ -4,7 +4,7 @@
--------------------------
When this directive is used, authorization information is obtained
-from :term:`ACL` objects attached to model instances.
+from :term:`ACL` objects attached to :term:`resource` objects.
Attributes
~~~~~~~~~~
diff --git a/docs/zcml/resource.rst b/docs/zcml/asset.rst
index 3f7c58faa..af7a6db94 100644
--- a/docs/zcml/resource.rst
+++ b/docs/zcml/asset.rst
@@ -1,51 +1,51 @@
-.. _resource_directive:
+.. _asset_directive:
-``resource``
-------------
+``asset``
+---------
-The ``resource`` directive adds a resource override for a single
-resource.
+The ``asset`` directive adds an asset override for a single
+static file/directory asset.
Attributes
~~~~~~~~~~
``to_override``
- A :term:`resource specification` specifying the resource to be
+ A :term:`asset specification` specifying the asset to be
overridden.
``override_with``
- A :term:`resource specification` specifying the resource which
+ A :term:`asset specification` specifying the asset which
is used as the override.
Examples
~~~~~~~~
-.. topic:: Overriding a Single Resource File
+.. topic:: Overriding a Single Asset File
.. code-block:: xml
:linenos:
- <resource
+ <asset
to_override="some.package:templates/mytemplate.pt"
override_with="another.package:othertemplates/anothertemplate.pt"
/>
-.. topic:: Overriding all Resources in a Package
+.. topic:: Overriding all Assets in a Package
.. code-block:: xml
:linenos:
- <resource
+ <asset
to_override="some.package"
override_with="another.package"
/>
-.. topic:: Overriding all Resources in a Subdirectory of a Package
+.. topic:: Overriding all Assets in a Subdirectory of a Package
.. code-block:: xml
:linenos:
- <resource
+ <asset
to_override="some.package:templates/"
override_with="another.package:othertemplates/"
/>
@@ -53,10 +53,13 @@ Examples
Alternatives
~~~~~~~~~~~~
-The :meth:`pyramid.config.Configurator.override_resource`
+The :meth:`pyramid.config.Configurator.override_asset`
method can be used instead of the ``resource`` ZCML directive.
+This directive can also be invoked as the ``resource`` ZCML directive for
+backwards compatibility purposes.
+
See Also
~~~~~~~~
-See also :ref:`resource_zcml_directive`.
+See also :ref:`asset_zcml_directive`.
diff --git a/docs/zcml/forbidden.rst b/docs/zcml/forbidden.rst
index 7ea6b85fd..70f65069e 100644
--- a/docs/zcml/forbidden.rst
+++ b/docs/zcml/forbidden.rst
@@ -35,7 +35,7 @@ Attributes
``renderer``
This is either a single string term (e.g. ``json``) or a string
- implying a path or :term:`resource specification`
+ implying a path or :term:`asset specification`
(e.g. ``templates/views.pt``) used when the view returns a
non-:term:`response` object. This attribute has the same meaning as
it would in the context of :ref:`view_directive`; see the
diff --git a/docs/zcml/handler.rst b/docs/zcml/handler.rst
index 301bf7895..01d442ab6 100644
--- a/docs/zcml/handler.rst
+++ b/docs/zcml/handler.rst
@@ -28,7 +28,7 @@ Attributes
``factory``
The :term:`dotted Python name` to a function that will generate a
:app:`Pyramid` context object when the associated route matches.
- e.g. ``mypackage.models.MyFactoryClass``. If this argument is not
+ e.g. ``mypackage.resources.MyResource``. If this argument is not
specified, a default root factory will be used.
``xhr``
diff --git a/docs/zcml/notfound.rst b/docs/zcml/notfound.rst
index a2ed95bc4..739eccd49 100644
--- a/docs/zcml/notfound.rst
+++ b/docs/zcml/notfound.rst
@@ -34,7 +34,7 @@ Attributes
``renderer``
This is either a single string term (e.g. ``json``) or a string
- implying a path or :term:`resource specification`
+ implying a path or :term:`asset specification`
(e.g. ``templates/views.pt``) used when the view returns a
non-:term:`response` object. This attribute has the same meaning as
it would in the context of :ref:`view_directive`; see the
diff --git a/docs/zcml/route.rst b/docs/zcml/route.rst
index 4f7cdb955..0f94fa11b 100644
--- a/docs/zcml/route.rst
+++ b/docs/zcml/route.rst
@@ -25,7 +25,7 @@ Attributes
``factory``
The :term:`dotted Python name` to a function that will generate a
:app:`Pyramid` context object when this route matches.
- e.g. ``mypackage.models.MyFactoryClass``. If this argument is not
+ e.g. ``mypackage.resources.MyResource``. If this argument is not
specified, a default root factory will be used.
``view``
@@ -172,7 +172,7 @@ Attributes
``view_renderer``
This is either a single string term (e.g. ``json``) or a string
- implying a path or :term:`resource specification`
+ implying a path or :term:`asset specification`
(e.g. ``templates/views.pt``). If the renderer value is a single
term (does not contain a dot ``.``), the specified term will be used
to look up a renderer implementation, and that renderer
diff --git a/docs/zcml/view.rst b/docs/zcml/view.rst
index 74d497cb3..b4fabdc2c 100644
--- a/docs/zcml/view.rst
+++ b/docs/zcml/view.rst
@@ -51,7 +51,7 @@ Non-Predicate Attributes
``renderer``
This is either a single string term (e.g. ``json``) or a string
- implying a path or :term:`resource specification`
+ implying a path or :term:`asset specification`
(e.g. ``templates/views.pt``). If the renderer value is a single
term (does not contain a dot ``.``), the specified term will be used
to look up a renderer implementation, and that renderer
@@ -72,10 +72,10 @@ Non-Predicate Attributes
template named "foo.pt" is in the "templates" directory relative to
the directory in which the ZCML file is defined), a path can be
absolute, starting with a slash on UNIX or a drive letter prefix on
- Windows. The path can alternately be a :term:`resource
+ Windows. The path can alternately be a :term:`asset
specification` in the form
``some.dotted.package_name:relative/path``, making it possible to
- address template resources which live in a separate package.
+ address template assets which live in a separate package.
The ``renderer`` attribute is optional. If it is not defined, the
"null" renderer is assumed (no rendering is performed and the value
@@ -157,7 +157,7 @@ Predicate Attributes
representing the class that a graph traversal parent object of the
:term:`context` must be an instance of (or :term:`interface` that a
parent object must provide) in order for this view to be found and
- called. Your models must be "location-aware" to use this feature.
+ called. Your resources must be "location-aware" to use this feature.
See :ref:`location_aware` for more information about
location-awareness.
@@ -222,7 +222,7 @@ Examples
:linenos:
<view
- context=".models.MyModel"
+ context=".resources.MyResource"
view=".views.hello_world"
/>
@@ -232,7 +232,7 @@ Examples
:linenos:
<view
- context=".models.MyModel"
+ context=".resources.MyResource"
view=".views.hello_world_post"
request_method="POST"
/>