Skip to content

Commit

Permalink
docs: documentation updates to reflect addition of mutually exclusive…
Browse files Browse the repository at this point in the history
… attributes
  • Loading branch information
walterrowe authored and JohnVillalovos committed Jun 6, 2022
1 parent 0e3c461 commit 24b720e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
9 changes: 5 additions & 4 deletions docs/api-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 18 additions & 6 deletions docs/ext/manager_tmpl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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 %}
Expand Down

0 comments on commit 24b720e

Please sign in to comment.