Skip to content

docs: update docs to reflect addition of mutually exclusive attributes #2057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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