Skip to content

Commit 0f607f6

Browse files
authored
Merge pull request #2057 from walterrowe/main
docs: update docs to reflect addition of mutually exclusive attributes
2 parents aebf9c8 + 24b720e commit 0f607f6

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

docs/api-usage.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ Examples:
113113
items when using listing methods. See the :ref:`pagination` section for more
114114
information.
115115

116-
You can list the mandatory and optional attributes for object creation and
117-
update with the manager's ``get_create_attrs()`` and ``get_update_attrs()``
118-
methods. They return 2 tuples, the first one is the list of mandatory
119-
attributes, the second one is the list of optional attribute:
116+
You can list the mandatory, optional, and mutually exclusive attributes for object
117+
creation and update with the manager's ``get_create_attrs()`` and ``get_update_attrs()``
118+
methods. They return 3 tuples. The first tuple is the list of mandatory attributes.
119+
The second tuple is the list of optional attributes. The third tuple is the mutually
120+
exclusive attributes:
120121

121122
.. code-block:: python
122123

docs/ext/manager_tmpl.j2

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
{% if cls._create_attrs %}
99
**Object Creation**
1010
{% if cls._create_attrs[0] %}
11-
Mandatory attributes:
12-
{% for item in cls._create_attrs[0] %}
11+
Mandatory attributes for object create:
12+
{% for item in cls._create_attrs.required %}
1313
- ``{{ item }}``
1414
{% endfor %}
1515
{% endif %}
1616
{% if cls._create_attrs[1] %}
17-
Optional attributes:
18-
{% for item in cls._create_attrs[1] %}
17+
Optional attributes for object create:
18+
{% for item in cls._create_attrs.optional %}
19+
- ``{{ item }}``
20+
{% endfor %}
21+
{% endif %}
22+
{% if cls._create_attrs[2] %}
23+
Mutually exclusive attributes for object create:
24+
{% for item in cls._create_attrs.exlusive %}
1925
- ``{{ item }}``
2026
{% endfor %}
2127
{% endif %}
@@ -25,13 +31,19 @@ Optional attributes:
2531
**Object update**
2632
{% if cls._update_attrs[0] %}
2733
Mandatory attributes for object update:
28-
{% for item in cls._update_attrs[0] %}
34+
{% for item in cls._update_attrs.required %}
2935
- ``{{ item }}``
3036
{% endfor %}
3137
{% endif %}
3238
{% if cls._update_attrs[1] %}
3339
Optional attributes for object update:
34-
{% for item in cls._update_attrs[1] %}
40+
{% for item in cls._update_attrs.optional %}
41+
- ``{{ item }}``
42+
{% endfor %}
43+
{% endif %}
44+
{% if cls._update_attrs[2] %}
45+
Mutually exclusive attributes for object update:
46+
{% for item in cls._update_attrs.exlusive %}
3547
- ``{{ item }}``
3648
{% endfor %}
3749
{% endif %}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy