|
1 |
| -Manager for {{ cls | classref() }} objects. |
2 |
| - |
3 |
| -{%ifcls.canUpdate%} |
4 |
| -{{ cls | classref() }} objects can be updated. |
5 |
| -{%else%} |
6 |
| -{{ cls | classref() }} objects **cannot** be updated. |
| 1 | +{%ifcls._list_filters%} |
| 2 | +**Object listing filters** |
| 3 | +{%foritemincls._list_filters%} |
| 4 | +- ``{{ item }}`` |
| 5 | +{%endfor%} |
7 | 6 | {%endif%}
|
8 | 7 |
|
9 |
| -{%ifcls.canList%} |
10 |
| -.. method:: list(**kwargs) |
11 |
| - |
12 |
| - Returns a list of objects of type {{ cls | classref() }}. |
13 |
| - |
14 |
| - Available keys for ``kwargs`` are: |
15 |
| - |
16 |
| -{%forkincls.requiredListAttrs%} |
17 |
| - * ``{{ k }}`` (required) |
18 |
| -{%endfor%} |
19 |
| -{%forkincls.optionalListAttrs%} |
20 |
| - * ``{{ k }}`` (optional) |
21 |
| -{%endfor%} |
22 |
| - * ``per_page`` (int): number of item per page. May be limited by the server. |
23 |
| - * ``page`` (int): page to retrieve |
24 |
| - * ``all`` (bool): iterate over all the pages and return all the entries |
25 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
26 |
| - permissions) |
| 8 | +{%ifcls._create_attrs%} |
| 9 | +**Object Creation** |
| 10 | +{%ifcls._create_attrs[0]%} |
| 11 | +Mandatory attributes: |
| 12 | +{%foritemincls._create_attrs[0]%} |
| 13 | +- ``{{ item }}`` |
| 14 | +{%endfor%} |
27 | 15 | {%endif%}
|
28 |
| - |
29 |
| -{%ifcls.canGet%} |
30 |
| -{%ifcls.getRequiresId%} |
31 |
| -.. method:: get(id, **kwargs) |
32 |
| - |
33 |
| - Get a single object of type {{ cls | classref() }} using its ``id``. |
34 |
| -{%else%} |
35 |
| -.. method:: get(**kwargs) |
36 |
| - |
37 |
| - Get a single object of type {{ cls | classref() }}. |
| 16 | +{%ifcls._create_attrs[1]%} |
| 17 | +Optional attributes: |
| 18 | +{%foritemincls._create_attrs[1]%} |
| 19 | +- ``{{ item }}`` |
| 20 | +{%endfor%} |
38 | 21 | {%endif%}
|
39 |
| - |
40 |
| - Available keys for ``kwargs`` are: |
41 |
| - |
42 |
| -{%forkincls.requiredGetAttrs%} |
43 |
| - * ``{{ k }}`` (required) |
44 |
| -{%endfor%} |
45 |
| -{%forkincls.optionalGetAttrs%} |
46 |
| - * ``{{ k }}`` (optional) |
47 |
| -{%endfor%} |
48 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
49 |
| - permissions) |
50 | 22 | {%endif%}
|
51 | 23 |
|
52 |
| -{%ifcls.canCreate%} |
53 |
| -.. method:: create(data, **kwargs) |
54 |
| - |
55 |
| - Create an object of type {{ cls | classref() }}. |
56 |
| - |
57 |
| - ``data`` is a dict defining the object attributes. Available attributes are: |
58 |
| - |
59 |
| -{%foraincls.requiredUrlAttrs%} |
60 |
| - * ``{{ a }}`` (required if not discovered on the parent objects) |
61 |
| -{%endfor%} |
62 |
| -{%foraincls.requiredCreateAttrs%} |
63 |
| - * ``{{ a }}`` (required) |
64 |
| -{%endfor%} |
65 |
| -{%foraincls.optionalCreateAttrs%} |
66 |
| - * ``{{ a }}`` (optional) |
67 |
| -{%endfor%} |
68 |
| - |
69 |
| - Available keys for ``kwargs`` are: |
70 |
| - |
71 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
72 |
| - permissions) |
| 24 | +{%ifcls._update_attrs%} |
| 25 | +**Object update** |
| 26 | +{%ifcls._update_attrs[0]%} |
| 27 | +Mandatory attributes for object update: |
| 28 | +{%foritemincls._update_attrs[0]%} |
| 29 | +- ``{{ item }}`` |
| 30 | +{%endfor%} |
| 31 | +{%endif%} |
| 32 | +{%ifcls._update_attrs[1]%} |
| 33 | +Optional attributes for object update: |
| 34 | +{%foritemincls._update_attrs[1]%} |
| 35 | +- ``{{ item }}`` |
| 36 | +{%endfor%} |
73 | 37 | {%endif%}
|
74 |
| - |
75 |
| -{%ifcls.canDelete%} |
76 |
| -.. method:: delete(id, **kwargs) |
77 |
| - |
78 |
| - Delete the object with ID ``id``. |
79 |
| - |
80 |
| - Available keys for ``kwargs`` are: |
81 |
| - |
82 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
83 |
| - permissions) |
84 | 38 | {%endif%}
|