From 24b720e49636044f4be7e4d6e6ce3da341f2aeb8 Mon Sep 17 00:00:00 2001 From: Walter Rowe Date: Sun, 5 Jun 2022 18:51:10 -0400 Subject: [PATCH] docs: documentation updates to reflect addition of mutually exclusive attributes --- docs/api-usage.rst | 9 +++++---- docs/ext/manager_tmpl.j2 | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/api-usage.rst b/docs/api-usage.rst index aa6c4fe2c..6d323b98e 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -113,10 +113,11 @@ Examples: items when using listing methods. See the :ref:`pagination` section for more information. -You can list the mandatory and optional attributes for object creation and -update with the manager's ``get_create_attrs()`` and ``get_update_attrs()`` -methods. They return 2 tuples, the first one is the list of mandatory -attributes, the second one is the list of optional attribute: +You can list the mandatory, optional, and mutually exclusive attributes for object +creation and update with the manager's ``get_create_attrs()`` and ``get_update_attrs()`` +methods. They return 3 tuples. The first tuple is the list of mandatory attributes. +The second tuple is the list of optional attributes. The third tuple is the mutually +exclusive attributes: .. code-block:: python diff --git a/docs/ext/manager_tmpl.j2 b/docs/ext/manager_tmpl.j2 index 6e71c0c1e..c6fd125ba 100644 --- a/docs/ext/manager_tmpl.j2 +++ b/docs/ext/manager_tmpl.j2 @@ -8,14 +8,20 @@ {% if cls._create_attrs %} **Object Creation** {% if cls._create_attrs[0] %} -Mandatory attributes: -{% for item in cls._create_attrs[0] %} +Mandatory attributes for object create: +{% for item in cls._create_attrs.required %} - ``{{ item }}`` {% endfor %} {% endif %} {% if cls._create_attrs[1] %} -Optional attributes: -{% for item in cls._create_attrs[1] %} +Optional attributes for object create: +{% for item in cls._create_attrs.optional %} +- ``{{ item }}`` +{% endfor %} +{% endif %} +{% if cls._create_attrs[2] %} +Mutually exclusive attributes for object create: +{% for item in cls._create_attrs.exlusive %} - ``{{ item }}`` {% endfor %} {% endif %} @@ -25,13 +31,19 @@ Optional attributes: **Object update** {% if cls._update_attrs[0] %} Mandatory attributes for object update: -{% for item in cls._update_attrs[0] %} +{% for item in cls._update_attrs.required %} - ``{{ item }}`` {% endfor %} {% endif %} {% if cls._update_attrs[1] %} Optional attributes for object update: -{% for item in cls._update_attrs[1] %} +{% for item in cls._update_attrs.optional %} +- ``{{ item }}`` +{% endfor %} +{% endif %} +{% if cls._update_attrs[2] %} +Mutually exclusive attributes for object update: +{% for item in cls._update_attrs.exlusive %} - ``{{ item }}`` {% endfor %} {% endif %}