drf-to-mkdoc 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of drf-to-mkdoc might be problematic. Click here for more details.
- drf_to_mkdoc/conf/defaults.py +1 -0
- drf_to_mkdoc/conf/settings.py +0 -2
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/form-manager.js +172 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/main.js +22 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/modal.js +79 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/request-executor.js +111 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/suggestions.js +216 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/tabs.js +34 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/buttons.css +71 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/fab.css +47 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/form.css +124 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/key-value.css +161 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/main.css +57 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/modal.css +112 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/response.css +158 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/tabs.css +62 -0
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/variables.css +38 -0
- drf_to_mkdoc/templates/endpoints/detail/base.html +35 -0
- drf_to_mkdoc/templates/endpoints/detail/path_parameters.html +8 -0
- drf_to_mkdoc/templates/endpoints/detail/query_parameters.html +36 -0
- drf_to_mkdoc/templates/endpoints/detail/request_body.html +10 -0
- drf_to_mkdoc/templates/endpoints/detail/responses.html +18 -0
- drf_to_mkdoc/templates/endpoints/list/base.html +23 -0
- drf_to_mkdoc/templates/endpoints/list/endpoint_card.html +18 -0
- drf_to_mkdoc/templates/endpoints/list/filter_section.html +16 -0
- drf_to_mkdoc/templates/endpoints/list/filters/app.html +8 -0
- drf_to_mkdoc/templates/endpoints/list/filters/method.html +12 -0
- drf_to_mkdoc/templates/endpoints/list/filters/path.html +5 -0
- drf_to_mkdoc/templates/endpoints/list/filters/search.html +9 -0
- drf_to_mkdoc/templates/model_detail/base.html +34 -0
- drf_to_mkdoc/templates/model_detail/choices.html +12 -0
- drf_to_mkdoc/templates/model_detail/fields.html +11 -0
- drf_to_mkdoc/templates/model_detail/meta.html +6 -0
- drf_to_mkdoc/templates/model_detail/methods.html +9 -0
- drf_to_mkdoc/templates/model_detail/relationships.html +8 -0
- drf_to_mkdoc/templates/models_index.html +24 -0
- drf_to_mkdoc/templates/try-out/fab.html +4 -0
- drf_to_mkdoc/templates/try-out/form.html +113 -0
- drf_to_mkdoc/templates/try-out/main.html +4 -0
- drf_to_mkdoc/templates/try-out/modal.html +14 -0
- drf_to_mkdoc/templates/try-out/response-modal.html +20 -0
- drf_to_mkdoc/templatetags/custom_filters.py +148 -0
- drf_to_mkdoc/utils/commons/schema_utils.py +5 -14
- drf_to_mkdoc/utils/endpoint_detail_generator.py +201 -171
- drf_to_mkdoc/utils/endpoint_list_generator.py +58 -193
- drf_to_mkdoc/utils/extractors/query_parameter_extractors.py +0 -15
- drf_to_mkdoc/utils/model_detail_generator.py +22 -202
- drf_to_mkdoc/utils/model_list_generator.py +26 -44
- drf_to_mkdoc/utils/schema.py +1 -1
- {drf_to_mkdoc-0.2.1.dist-info → drf_to_mkdoc-0.2.3.dist-info}/METADATA +1 -1
- drf_to_mkdoc-0.2.3.dist-info/RECORD +103 -0
- drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out-sidebar.js +0 -879
- drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/try-out-sidebar.css +0 -728
- drf_to_mkdoc/utils/md_generators/__init__.py +0 -0
- drf_to_mkdoc/utils/md_generators/query_parameters_generators.py +0 -72
- drf_to_mkdoc-0.2.1.dist-info/RECORD +0 -67
- {drf_to_mkdoc-0.2.1.dist-info → drf_to_mkdoc-0.2.3.dist-info}/WHEEL +0 -0
- {drf_to_mkdoc-0.2.1.dist-info → drf_to_mkdoc-0.2.3.dist-info}/licenses/LICENSE +0 -0
- {drf_to_mkdoc-0.2.1.dist-info → drf_to_mkdoc-0.2.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/* Response Modal */
|
|
2
|
+
.response-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
z-index: var(--try-out-z-response);
|
|
9
|
+
display: none;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
padding: var(--try-out-spacing-lg);
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.response-modal .modal-header {
|
|
17
|
+
padding: var(--try-out-spacing-lg) var(--try-out-spacing-xl);
|
|
18
|
+
background: linear-gradient(135deg, var(--try-out-primary), #1565c0);
|
|
19
|
+
color: white;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--try-out-spacing);
|
|
23
|
+
flex-shrink: 0;
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.response-modal .modal-header h3 {
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-size: var(--try-out-font-lg);
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.response-modal .modal-close {
|
|
35
|
+
background: none;
|
|
36
|
+
border: none;
|
|
37
|
+
color: white;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
padding: var(--try-out-spacing-sm);
|
|
40
|
+
font-size: var(--try-out-font-lg);
|
|
41
|
+
line-height: 1;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
width: 28px;
|
|
44
|
+
height: 28px;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
position: absolute;
|
|
49
|
+
right: var(--try-out-spacing);
|
|
50
|
+
top: 50%;
|
|
51
|
+
transform: translateY(-50%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.response-modal .modal-close:hover {
|
|
55
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.response-modal .modal-body {
|
|
59
|
+
padding: var(--try-out-spacing-xl);
|
|
60
|
+
overflow-y: auto;
|
|
61
|
+
flex: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.response-modal.show {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.response-modal .modal-content {
|
|
69
|
+
position: relative;
|
|
70
|
+
width: 100%;
|
|
71
|
+
max-width: 700px;
|
|
72
|
+
max-height: 85vh;
|
|
73
|
+
background-color: var(--try-out-bg);
|
|
74
|
+
border-radius: var(--try-out-border-radius-lg);
|
|
75
|
+
box-shadow: 0 8px 32px var(--try-out-shadow-strong);
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.response-modal .response-header {
|
|
83
|
+
margin-bottom: var(--try-out-spacing-lg);
|
|
84
|
+
padding: var(--try-out-spacing);
|
|
85
|
+
border-radius: var(--try-out-border-radius);
|
|
86
|
+
background-color: var(--try-out-surface);
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
gap: var(--try-out-spacing);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.response-modal .status-badge {
|
|
93
|
+
padding: var(--try-out-spacing-sm) var(--try-out-spacing);
|
|
94
|
+
border-radius: var(--try-out-border-radius);
|
|
95
|
+
font-size: var(--try-out-font-sm);
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.response-modal .status-200 {
|
|
101
|
+
background-color: var(--try-out-success);
|
|
102
|
+
color: white;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.response-modal .status-300 {
|
|
106
|
+
background-color: var(--try-out-info);
|
|
107
|
+
color: white;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.response-modal .status-400 {
|
|
111
|
+
background-color: var(--try-out-warning);
|
|
112
|
+
color: #212529;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.response-modal .status-500 {
|
|
116
|
+
background-color: var(--try-out-danger);
|
|
117
|
+
color: white;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.response-modal .response-body {
|
|
121
|
+
background-color: var(--try-out-surface);
|
|
122
|
+
padding: var(--try-out-spacing-lg);
|
|
123
|
+
border-radius: var(--try-out-border-radius);
|
|
124
|
+
overflow: auto;
|
|
125
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
126
|
+
white-space: pre-wrap;
|
|
127
|
+
font-size: var(--try-out-font-sm);
|
|
128
|
+
line-height: var(--try-out-line-height);
|
|
129
|
+
max-height: 300px;
|
|
130
|
+
border: 1px solid var(--try-out-border);
|
|
131
|
+
flex: 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.response-modal .response-info {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
gap: var(--try-out-spacing);
|
|
138
|
+
font-size: var(--try-out-font-base);
|
|
139
|
+
color: var(--try-out-text);
|
|
140
|
+
font-weight: 500;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Mobile Response Modal */
|
|
144
|
+
@media screen and (max-width: 768px) {
|
|
145
|
+
.response-modal {
|
|
146
|
+
padding: var(--try-out-spacing-sm);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.response-modal .modal-content {
|
|
150
|
+
max-width: none;
|
|
151
|
+
max-height: 90vh;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.response-modal .response-body {
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
max-height: 250px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Tabs */
|
|
2
|
+
.tabs {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 0;
|
|
5
|
+
margin-bottom: var(--try-out-spacing-lg);
|
|
6
|
+
border: 1px solid var(--try-out-border);
|
|
7
|
+
border-radius: var(--try-out-border-radius);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
background-color: var(--try-out-surface);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tab {
|
|
13
|
+
flex: 1;
|
|
14
|
+
padding: var(--try-out-spacing) var(--try-out-spacing-lg);
|
|
15
|
+
border: none;
|
|
16
|
+
background: transparent;
|
|
17
|
+
color: var(--try-out-text-light);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font-size: var(--try-out-font-base);
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
position: relative;
|
|
22
|
+
transition: var(--try-out-transition);
|
|
23
|
+
border-right: 1px solid var(--try-out-border);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tab:last-child {
|
|
27
|
+
border-right: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tab:hover {
|
|
31
|
+
background-color: rgba(25, 118, 210, 0.05);
|
|
32
|
+
color: var(--try-out-text);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tab.active {
|
|
36
|
+
background-color: var(--try-out-primary);
|
|
37
|
+
color: white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tab-content {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.tab-content.active {
|
|
45
|
+
display: block;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Mobile Tabs */
|
|
49
|
+
@media screen and (max-width: 768px) {
|
|
50
|
+
.tabs {
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tab {
|
|
55
|
+
border-right: none;
|
|
56
|
+
border-bottom: 1px solid var(--try-out-border);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tab:last-child {
|
|
60
|
+
border-bottom: none;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--try-out-primary: #1976d2;
|
|
3
|
+
--try-out-primary-hover: #1565c0;
|
|
4
|
+
--try-out-success: #28a745;
|
|
5
|
+
--try-out-success-hover: #218838;
|
|
6
|
+
--try-out-danger: #dc3545;
|
|
7
|
+
--try-out-danger-hover: #c82333;
|
|
8
|
+
--try-out-warning: #ffc107;
|
|
9
|
+
--try-out-info: #17a2b8;
|
|
10
|
+
|
|
11
|
+
--try-out-bg: #ffffff;
|
|
12
|
+
--try-out-surface: #f8f9fa;
|
|
13
|
+
--try-out-border: #e1e5e9;
|
|
14
|
+
--try-out-text: #333333;
|
|
15
|
+
--try-out-text-light: #666666;
|
|
16
|
+
--try-out-text-lighter: #999999;
|
|
17
|
+
--try-out-shadow: rgba(0, 0, 0, 0.1);
|
|
18
|
+
--try-out-shadow-strong: rgba(0, 0, 0, 0.2);
|
|
19
|
+
|
|
20
|
+
--try-out-border-radius: 4px;
|
|
21
|
+
--try-out-border-radius-lg: 6px;
|
|
22
|
+
--try-out-spacing-xs: 0.2rem;
|
|
23
|
+
--try-out-spacing-sm: 0.4rem;
|
|
24
|
+
--try-out-spacing: 0.6rem;
|
|
25
|
+
--try-out-spacing-lg: 0.8rem;
|
|
26
|
+
--try-out-spacing-xl: 1.2rem;
|
|
27
|
+
--try-out-spacing-xxl: 1.6rem;
|
|
28
|
+
|
|
29
|
+
--try-out-font-sm: 0.75rem;
|
|
30
|
+
--try-out-font-base: 0.8rem;
|
|
31
|
+
--try-out-font-lg: 0.9rem;
|
|
32
|
+
--try-out-line-height: 1.4;
|
|
33
|
+
|
|
34
|
+
--try-out-transition: all 0.2s ease;
|
|
35
|
+
--try-out-z-modal: 1000;
|
|
36
|
+
--try-out-z-response: 1100;
|
|
37
|
+
--try-out-z-fab: 100;
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!-- inject CSS and JS directly -->
|
|
2
|
+
{% load custom_filters %}
|
|
3
|
+
{% for stylesheet in stylesheets %}
|
|
4
|
+
<link rel="stylesheet" href="{% static_with_prefix stylesheet prefix_path %}">
|
|
5
|
+
{% endfor %}
|
|
6
|
+
{% for script in scripts %}
|
|
7
|
+
<script src="{% static_with_prefix script prefix_path %}" defer></script>
|
|
8
|
+
{% endfor %}
|
|
9
|
+
|
|
10
|
+
# {{ method|upper }} {{ path }}
|
|
11
|
+
|
|
12
|
+
{{ method|format_method_badge|safe }} `{{ path }}`
|
|
13
|
+
|
|
14
|
+
**View class:** {{ viewset_name }}
|
|
15
|
+
|
|
16
|
+
{% if summary %}
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
{{ summary }}
|
|
20
|
+
{% endif %}
|
|
21
|
+
|
|
22
|
+
{% if operation_id %}
|
|
23
|
+
**Operation ID:** `{{ operation_id }}`
|
|
24
|
+
{% endif %}
|
|
25
|
+
|
|
26
|
+
{% if description %}
|
|
27
|
+
{{ description|safe }}
|
|
28
|
+
{% endif %}
|
|
29
|
+
|
|
30
|
+
{% include "endpoints/detail/path_parameters.html" %}
|
|
31
|
+
{% include "endpoints/detail/query_parameters.html" %}
|
|
32
|
+
{% include "endpoints/detail/request_body.html" %}
|
|
33
|
+
{% include "endpoints/detail/responses.html" %}
|
|
34
|
+
|
|
35
|
+
{% include 'try-out/main.html' %}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% if path_params %}
|
|
2
|
+
## Path Parameters
|
|
3
|
+
|
|
4
|
+
| Name | Type | Required | Description |
|
|
5
|
+
|------|------|----------|-------------|
|
|
6
|
+
{% for param in path_params %}| `{{ param.name }}` | `{{ param.schema.type|default:"string" }}` | {{ param.required|yesno:"Yes,No" }} | {{ param.description }} |{% endfor %}
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{% comment %}
|
|
2
|
+
Check if any query parameter fields have content
|
|
3
|
+
{% endcomment %}
|
|
4
|
+
|
|
5
|
+
{% if query_parameters.filter_fields or query_parameters.search_fields or query_parameters.ordering_fields or query_parameters.pagination_fields %}
|
|
6
|
+
## Query Parameters
|
|
7
|
+
|
|
8
|
+
{% if query_parameters.filter_fields %}
|
|
9
|
+
### Filter Fields
|
|
10
|
+
{% for field in query_parameters.filter_fields %}
|
|
11
|
+
- `{{ field }}`
|
|
12
|
+
{% endfor %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
15
|
+
{% if query_parameters.search_fields %}
|
|
16
|
+
### Search Fields
|
|
17
|
+
{% for field in query_parameters.search_fields %}
|
|
18
|
+
- `{{ field }}`
|
|
19
|
+
{% endfor %}
|
|
20
|
+
{% endif %}
|
|
21
|
+
|
|
22
|
+
{% if query_parameters.ordering_fields %}
|
|
23
|
+
### Ordering Fields
|
|
24
|
+
{% for field in query_parameters.ordering_fields %}
|
|
25
|
+
- `{{ field }}`
|
|
26
|
+
{% endfor %}
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
29
|
+
{% if query_parameters.pagination_fields %}
|
|
30
|
+
### Pagination Fields
|
|
31
|
+
{% for field in query_parameters.pagination_fields %}
|
|
32
|
+
- `{{ field }}`
|
|
33
|
+
{% endfor %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
|
|
36
|
+
{% endif %}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
|
|
3
|
+
{% if responses %}
|
|
4
|
+
## Responses
|
|
5
|
+
|
|
6
|
+
{% for response in responses %}
|
|
7
|
+
### {{ response.status_code }}
|
|
8
|
+
|
|
9
|
+
{% if response.description %}
|
|
10
|
+
{{ response.description }}
|
|
11
|
+
{% endif %}
|
|
12
|
+
|
|
13
|
+
{% for example in response.examples %}
|
|
14
|
+
{{ example|format_json }}
|
|
15
|
+
{% endfor %}
|
|
16
|
+
|
|
17
|
+
{% endfor %}
|
|
18
|
+
{% endif %}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# API Endpoints
|
|
2
|
+
|
|
3
|
+
<style>
|
|
4
|
+
{% for stylesheet in stylesheets %}
|
|
5
|
+
@import url("{{ stylesheet|safe }}");
|
|
6
|
+
{% endfor %}
|
|
7
|
+
</style>
|
|
8
|
+
|
|
9
|
+
{% for script in scripts %}
|
|
10
|
+
<script src="{{ script|safe }}" defer></script>
|
|
11
|
+
{% endfor %}
|
|
12
|
+
|
|
13
|
+
<div class="main-content">
|
|
14
|
+
{% include "endpoints/list/filter_section.html" %}
|
|
15
|
+
{% for app_name, endpoints in endpoints_by_app.items %}
|
|
16
|
+
<h2>{{ app_name|title }}</h2>
|
|
17
|
+
<div class="endpoints-grid">
|
|
18
|
+
{% for endpoint in endpoints %}
|
|
19
|
+
{% include "endpoints/list/endpoint_card.html" %}
|
|
20
|
+
{% endfor %}
|
|
21
|
+
</div>
|
|
22
|
+
{% endfor %}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
<a href="{{ endpoint.link_url }}" class="endpoint-card"
|
|
3
|
+
data-method="{{ endpoint.method|lower }}"
|
|
4
|
+
data-path="{{ endpoint.path|lower }}"
|
|
5
|
+
data-app="{{ app_name|lower }}"
|
|
6
|
+
data-auth="{{ endpoint.auth_required|default:'false'|lower }}"
|
|
7
|
+
data-pagination="{{ endpoint.pagination_support|default:'false'|lower }}"
|
|
8
|
+
data-search="{{ endpoint.view_class.search_fields|default:''|length|yesno:'true,false'|lower }}"
|
|
9
|
+
data-ordering="{{ endpoint.ordering_support|default:'false'|lower }}"
|
|
10
|
+
data-models="{{ endpoint.related_models|default:''|join:' '|lower }}"
|
|
11
|
+
data-roles="{{ endpoint.permission_roles|default:''|join:' '|lower }}"
|
|
12
|
+
data-content-type="{{ endpoint.content_type|default:''|lower }}"
|
|
13
|
+
data-tags="{{ endpoint.tags|default:''|join:' '|lower }}"
|
|
14
|
+
data-schema="{{ endpoint.schema_fields|default:''|join:' '|lower }}"
|
|
15
|
+
data-params="{{ endpoint.query_parameters|default:''|join:' '|lower }}">
|
|
16
|
+
<span class="method-badge method-{{ endpoint.method|lower }}">{{ endpoint.method }}</span>
|
|
17
|
+
<span class="endpoint-path">{{ endpoint.path }}</span>
|
|
18
|
+
</a>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="filter-sidebar collapsed" id="filterSidebar">
|
|
2
|
+
<h3 class="filter-title">🔍 Filters</h3>
|
|
3
|
+
<div class="filter-grid">
|
|
4
|
+
{% for filter_key in active_filters %}
|
|
5
|
+
{% include "endpoints/list/filters/"|add:filter_key|add:".html" %}
|
|
6
|
+
{% endfor %}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="filter-actions">
|
|
10
|
+
<button class="filter-apply" onclick="applyFilters()">Apply</button>
|
|
11
|
+
<button class="filter-clear" onclick="clearFilters()">Clear</button>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="filter-results">Showing 0 endpoints</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="filter-group">
|
|
2
|
+
<label class="filter-label">HTTP Method</label>
|
|
3
|
+
<select id="filter-method" class="filter-select">
|
|
4
|
+
<option value="">All</option>
|
|
5
|
+
<option value="get">GET</option>
|
|
6
|
+
<option value="post">POST</option>
|
|
7
|
+
<option value="put">PUT</option>
|
|
8
|
+
<option value="patch">PATCH</option>
|
|
9
|
+
<option value="delete">DELETE</option>
|
|
10
|
+
</select>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# {{ name }}
|
|
2
|
+
|
|
3
|
+
<!-- inject CSS directly -->
|
|
4
|
+
{% for stylesheet in stylesheets %}
|
|
5
|
+
<link rel="stylesheet" href="{{ stylesheet }}">
|
|
6
|
+
{% endfor %}
|
|
7
|
+
|
|
8
|
+
**App:** {{ app_label }}
|
|
9
|
+
|
|
10
|
+
**Table:** `{{ table_name }}`
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
{{ description }}
|
|
15
|
+
|
|
16
|
+
{% if fields %}
|
|
17
|
+
{% include "model_detail/fields.html" with fields=fields %}
|
|
18
|
+
{% endif %}
|
|
19
|
+
|
|
20
|
+
{% if has_choices %}
|
|
21
|
+
{% include "model_detail/choices.html" with fields=fields %}
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
{% if relationships %}
|
|
25
|
+
{% include "model_detail/relationships.html" with relationships=relationships %}
|
|
26
|
+
{% endif %}
|
|
27
|
+
|
|
28
|
+
{% if methods %}
|
|
29
|
+
{% include "model_detail/methods.html" with methods=methods %}
|
|
30
|
+
{% endif %}
|
|
31
|
+
|
|
32
|
+
{% if meta_options %}
|
|
33
|
+
{% include "model_detail/meta.html" with meta_options=meta_options %}
|
|
34
|
+
{% endif %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
## Choices
|
|
3
|
+
|
|
4
|
+
{% for field_name, field_info in fields.items %}{% if field_info.choices %}
|
|
5
|
+
### {{ field_name }} Choices
|
|
6
|
+
|
|
7
|
+
| Label | Value |
|
|
8
|
+
|-------|-------|
|
|
9
|
+
{% for choice in field_info.choices %}| {{ choice.display }} | `{{ choice.value }}` |
|
|
10
|
+
{% endfor %}
|
|
11
|
+
|
|
12
|
+
{% endif %}{% endfor %}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
## Fields
|
|
3
|
+
|
|
4
|
+
| Field | Type | Description | Extra |
|
|
5
|
+
|-------|------|-------------|-------|
|
|
6
|
+
{% for field_name, field_info in fields.items %}{% with field_type=field_info.type|default:"Unknown" %}{% if field_type == "TextField" %}| `{{ field_name }}` | TextField | {{ field_name }} | {% if field_info.max_length %}max_length={{ field_info.max_length }}{% endif %} |
|
|
7
|
+
{% elif field_type == "BigAutoField" %}| `{{ field_name }}` | BigAutoField | ID | {% if field_info.blank %}blank=True{% endif %}{% if field_info.unique %}, unique=True{% endif %}{% if field_info.primary_key %}, primary_key=True{% endif %} |
|
|
8
|
+
{% elif field_type == "CharField" %}| `{{ field_name }}` | CharField | {{ field_name }} | {% if field_info.max_length %}max_length={{ field_info.max_length }}{% endif %}{% if field_info.null %}, null=True{% endif %}{% if field_info.blank %}, blank=True{% endif %} |
|
|
9
|
+
{% elif field_type == "ForeignKey" %}| `{{ field_name }}` | ForeignKey | {{ field_info.field_specific.to|default:"" }} | |
|
|
10
|
+
{% else %}| `{{ field_name }}` | {{ field_type }} | {{ field_name }} | {{ field_info|format_field_extra }} |
|
|
11
|
+
{% endif %}{% endwith %}{% endfor %}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
## Relationships
|
|
3
|
+
|
|
4
|
+
| Field | Type | Related Model |
|
|
5
|
+
|-------|------|---------------|
|
|
6
|
+
{% for field_name, field_info in relationships.items %}{% with field_type=field_info.type|default:"Unknown" %}{% if field_info.field_specific.to %}| `{{ field_name }}` | {{ field_type }} | {% if "." in field_info.field_specific.to %}[{{ field_info.field_specific.to|cut:"." }}](../{{ field_info.field_specific.to|cut:"." }}/{% else %}[{{ field_info.field_specific.to }}]({{ field_info.field_specific.to|lower }}/{% endif %} |
|
|
7
|
+
{% endif %}{% endwith %}{% endfor %}{% for rel_name, rel_info in relationships.items %}| `{{ rel_name }}` | {{ rel_info.type|default:"Unknown" }} | [{{ rel_info.verbose_name|capfirst }}](../../{{ rel_info.app_label }}/{{ rel_info.table_name }}/) |
|
|
8
|
+
{% endfor %}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% load custom_filters %}
|
|
2
|
+
# Django Models
|
|
3
|
+
|
|
4
|
+
This section contains documentation for all Django models in the system, organized by Django application.
|
|
5
|
+
|
|
6
|
+
<!-- inject CSS directly -->
|
|
7
|
+
{% for css in stylesheets %}
|
|
8
|
+
<link rel="stylesheet" href="{{ css }}">
|
|
9
|
+
{% endfor %}
|
|
10
|
+
|
|
11
|
+
<div class="models-container">
|
|
12
|
+
{% for app_name, models in sorted_models %}
|
|
13
|
+
<div class="app-header">{{ app_name|title|cut:"_"|safe }}</div>
|
|
14
|
+
<div class="app-description">{{ app_descriptions|get_item:app_name }}</div>
|
|
15
|
+
|
|
16
|
+
<div class="model-cards">
|
|
17
|
+
{% for verbose_name, table_name in models %}
|
|
18
|
+
<a href="{{ app_name|urlencode }}/{{ table_name|urlencode }}/" class="model-card">{{ verbose_name }}</a>
|
|
19
|
+
{% endfor %}
|
|
20
|
+
</div>
|
|
21
|
+
{% endfor %}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
Each model page contains detailed field documentation, method signatures, and relationships to other models.
|