From 92c3e502494714884b7a051721c9b322027369a1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 18 Dec 2010 03:33:35 -0500 Subject: resource -> asset --- docs/zcml/aclauthorizationpolicy.rst | 2 +- docs/zcml/asset.rst | 65 ++++++++++++++++++++++++++++++++++++ docs/zcml/handler.rst | 2 +- docs/zcml/resource.rst | 62 ---------------------------------- docs/zcml/route.rst | 2 +- docs/zcml/view.rst | 6 ++-- 6 files changed, 71 insertions(+), 68 deletions(-) create mode 100644 docs/zcml/asset.rst delete mode 100644 docs/zcml/resource.rst (limited to 'docs/zcml') 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/asset.rst b/docs/zcml/asset.rst new file mode 100644 index 000000000..af7a6db94 --- /dev/null +++ b/docs/zcml/asset.rst @@ -0,0 +1,65 @@ +.. _asset_directive: + +``asset`` +--------- + +The ``asset`` directive adds an asset override for a single +static file/directory asset. + +Attributes +~~~~~~~~~~ + +``to_override`` + A :term:`asset specification` specifying the asset to be + overridden. + +``override_with`` + A :term:`asset specification` specifying the asset which + is used as the override. + +Examples +~~~~~~~~ + +.. topic:: Overriding a Single Asset File + + .. code-block:: xml + :linenos: + + + +.. topic:: Overriding all Assets in a Package + + .. code-block:: xml + :linenos: + + + +.. topic:: Overriding all Assets in a Subdirectory of a Package + + .. code-block:: xml + :linenos: + + + +Alternatives +~~~~~~~~~~~~ + +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:`asset_zcml_directive`. 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/resource.rst b/docs/zcml/resource.rst deleted file mode 100644 index 3f7c58faa..000000000 --- a/docs/zcml/resource.rst +++ /dev/null @@ -1,62 +0,0 @@ -.. _resource_directive: - -``resource`` ------------- - -The ``resource`` directive adds a resource override for a single -resource. - -Attributes -~~~~~~~~~~ - -``to_override`` - A :term:`resource specification` specifying the resource to be - overridden. - -``override_with`` - A :term:`resource specification` specifying the resource which - is used as the override. - -Examples -~~~~~~~~ - -.. topic:: Overriding a Single Resource File - - .. code-block:: xml - :linenos: - - - -.. topic:: Overriding all Resources in a Package - - .. code-block:: xml - :linenos: - - - -.. topic:: Overriding all Resources in a Subdirectory of a Package - - .. code-block:: xml - :linenos: - - - -Alternatives -~~~~~~~~~~~~ - -The :meth:`pyramid.config.Configurator.override_resource` -method can be used instead of the ``resource`` ZCML directive. - -See Also -~~~~~~~~ - -See also :ref:`resource_zcml_directive`. diff --git a/docs/zcml/route.rst b/docs/zcml/route.rst index 4f7cdb955..ac9261e27 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`` diff --git a/docs/zcml/view.rst b/docs/zcml/view.rst index 74d497cb3..6887f88fb 100644 --- a/docs/zcml/view.rst +++ b/docs/zcml/view.rst @@ -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: @@ -232,7 +232,7 @@ Examples :linenos: -- cgit v1.2.3 From a5ffd62175a09402fbe37ec8c2077873e0a35903 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 18 Dec 2010 15:12:46 -0500 Subject: model->resource; make docs render without warnings --- docs/zcml/forbidden.rst | 2 +- docs/zcml/notfound.rst | 2 +- docs/zcml/route.rst | 2 +- docs/zcml/view.rst | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/zcml') 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/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 ac9261e27..0f94fa11b 100644 --- a/docs/zcml/route.rst +++ b/docs/zcml/route.rst @@ -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 6887f88fb..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 -- cgit v1.2.3