5 |
6 | */
7 |
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | color: #333;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 | .hljs-comment,
17 | .diff .hljs-header,
18 | .hljs-javadoc {
19 | color: #998;
20 | font-style: italic;
21 | }
22 |
23 | .hljs-keyword,
24 | .css .rule .hljs-keyword,
25 | .hljs-winutils,
26 | .nginx .hljs-title,
27 | .hljs-subst,
28 | .hljs-request,
29 | .hljs-status {
30 | color: #333;
31 | font-weight: bold;
32 | }
33 |
34 | .hljs-number,
35 | .hljs-hexcolor,
36 | .ruby .hljs-constant {
37 | color: #008080;
38 | }
39 |
40 | .hljs-string,
41 | .hljs-tag .hljs-value,
42 | .hljs-phpdoc,
43 | .hljs-dartdoc,
44 | .tex .hljs-formula {
45 | color: #d14;
46 | }
47 |
48 | .hljs-title,
49 | .hljs-id,
50 | .scss .hljs-preprocessor {
51 | color: #900;
52 | font-weight: bold;
53 | }
54 |
55 | .hljs-list .hljs-keyword,
56 | .hljs-subst {
57 | font-weight: normal;
58 | }
59 |
60 | .hljs-class .hljs-title,
61 | .hljs-type,
62 | .vhdl .hljs-literal,
63 | .tex .hljs-command {
64 | color: #458;
65 | font-weight: bold;
66 | }
67 |
68 | .hljs-tag,
69 | .hljs-tag .hljs-title,
70 | .hljs-rule .hljs-property,
71 | .django .hljs-tag .hljs-keyword {
72 | color: #000080;
73 | font-weight: normal;
74 | }
75 |
76 | .hljs-attribute,
77 | .hljs-variable,
78 | .lisp .hljs-body,
79 | .hljs-name {
80 | color: #008080;
81 | }
82 |
83 | .hljs-regexp {
84 | color: #009926;
85 | }
86 |
87 | .hljs-symbol,
88 | .ruby .hljs-symbol .hljs-string,
89 | .lisp .hljs-keyword,
90 | .clojure .hljs-keyword,
91 | .scheme .hljs-keyword,
92 | .tex .hljs-special,
93 | .hljs-prompt {
94 | color: #990073;
95 | }
96 |
97 | .hljs-built_in {
98 | color: #0086b3;
99 | }
100 |
101 | .hljs-preprocessor,
102 | .hljs-pragma,
103 | .hljs-pi,
104 | .hljs-doctype,
105 | .hljs-shebang,
106 | .hljs-cdata {
107 | color: #999;
108 | font-weight: bold;
109 | }
110 |
111 | .hljs-deletion {
112 | background: #fdd;
113 | }
114 |
115 | .hljs-addition {
116 | background: #dfd;
117 | }
118 |
119 | .diff .hljs-change {
120 | background: #0086b3;
121 | }
122 |
123 | .hljs-chunk {
124 | color: #aaa;
125 | }
126 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/css/jquery.json-view.min.css:
--------------------------------------------------------------------------------
1 | .json-view{position:relative}
2 | .json-view .collapser{width:20px;height:18px;display:block;position:absolute;left:-1.7em;top:-.2em;z-index:5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYGBgOADE%2F3Hgw0DM4IRHgSsDFOzFInmMAQnY49ONzZRjDFiADT7dMLALiE8y4AGW6LoBAgwAuIkf%2F%2FB7O9sAAAAASUVORK5CYII%3D);background-repeat:no-repeat;background-position:center center;opacity:.5;cursor:pointer}
3 | .json-view .collapsed{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-khtml-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}
4 | .json-view .bl{display:block;padding-left:20px;margin-left:-20px;position:relative}
5 | .json-view{font-family:monospace}
6 | .json-view ul{list-style-type:none;padding-left:2em;border-left:1px dotted;margin:.3em}
7 | .json-view ul li{position:relative}
8 | .json-view .comments,.json-view .dots{display:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}
9 | .json-view .comments{padding-left:.8em;font-style:italic;color:#888}
10 | .json-view .bool,.json-view .null,.json-view .num,.json-view .undef{font-weight:700;color:#1A01CC}
11 | .json-view .str{color:#800}
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/favicon.ico
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/grid.png
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/js/jquery.json-view.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jquery.json-view - jQuery collapsible JSON plugin
3 | * @version v1.0.0
4 | * @link http://github.com/bazh/jquery.json-view
5 | * @license MIT
6 | */
7 | !function(e){"use strict";var n=function(n){var a=e(" ",{"class":"collapser",on:{click:function(){var n=e(this);n.toggleClass("collapsed");var a=n.parent().children(".block"),p=a.children("ul");n.hasClass("collapsed")?(p.hide(),a.children(".dots, .comments").show()):(p.show(),a.children(".dots, .comments").hide())}}});return n&&a.addClass("collapsed"),a},a=function(a,p){var t=e.extend({},{nl2br:!0},p),r=function(e){return e.toString()?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""},s=function(n,a){return e(" ",{"class":a,html:r(n)})},l=function(a,p){switch(e.type(a)){case"object":p||(p=0);var c=e(" ",{"class":"block"}),d=Object.keys(a).length;if(!d)return c.append(s("{","b")).append(" ").append(s("}","b"));c.append(s("{","b"));var i=e("",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e(" ").append(s('"',"q")).append(a).append(s('"',"q")).append(": ").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("}","b")),c.append(1===Object.keys(a).length?s("// 1 item","comments"):s("// "+Object.keys(a).length+" items","comments")),c;case"array":p||(p=0);var d=a.length,c=e(" ",{"class":"block"});if(!d)return c.append(s("[","b")).append(" ").append(s("]","b"));c.append(s("[","b"));var i=e("",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e(" ").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("]","b")),c.append(1===a.length?s("// 1 item","comments"):s("// "+a.length+" items","comments")),c;case"string":if(a=r(a),/^(http|https|file):\/\/[^\s]+$/i.test(a))return e(" ").append(s('"',"q")).append(e(" ",{href:a,text:a})).append(s('"',"q"));if(t.nl2br){var o=/\n/g;o.test(a)&&(a=(a+"").replace(o," "))}var u=e(" ",{"class":"str"}).html(a);return e(" ").append(s('"',"q")).append(u).append(s('"',"q"));case"number":return s(a.toString(),"num");case"undefined":return s("undefined","undef");case"null":return s("null","null");case"boolean":return s(a?"true":"false","bool")}};return l(a)};return e.fn.jsonView=function(n,p){var t=e(this);if(p=e.extend({},{nl2br:!0},p),"string"==typeof n)try{n=JSON.parse(n)}catch(r){}return t.append(e("
",{"class":"json-view"}).append(a(n,p))),t}}(jQuery);
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/img/grid.png
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/js/ajax-form.js:
--------------------------------------------------------------------------------
1 | function replaceDocument(docString) {
2 | var doc = document.open("text/html");
3 |
4 | doc.write(docString);
5 | doc.close();
6 | }
7 |
8 | function doAjaxSubmit(e) {
9 | var form = $(this);
10 | var btn = $(this.clk);
11 | var method = (
12 | btn.data('method') ||
13 | form.data('method') ||
14 | form.attr('method') || 'GET'
15 | ).toUpperCase();
16 |
17 | if (method === 'GET') {
18 | // GET requests can always use standard form submits.
19 | return;
20 | }
21 |
22 | var contentType =
23 | form.find('input[data-override="content-type"]').val() ||
24 | form.find('select[data-override="content-type"] option:selected').text();
25 |
26 | if (method === 'POST' && !contentType) {
27 | // POST requests can use standard form submits, unless we have
28 | // overridden the content type.
29 | return;
30 | }
31 |
32 | // At this point we need to make an AJAX form submission.
33 | e.preventDefault();
34 |
35 | var url = form.attr('action');
36 | var data;
37 |
38 | if (contentType) {
39 | data = form.find('[data-override="content"]').val() || ''
40 |
41 | if (contentType === 'multipart/form-data') {
42 | // We need to add a boundary parameter to the header
43 | // We assume the first valid-looking boundary line in the body is correct
44 | // regex is from RFC 2046 appendix A
45 | var boundaryCharNoSpace = "0-9A-Z'()+_,-./:=?";
46 | var boundaryChar = boundaryCharNoSpace + ' ';
47 | var re = new RegExp('^--([' + boundaryChar + ']{0,69}[' + boundaryCharNoSpace + '])[\\s]*?$', 'im');
48 | var boundary = data.match(re);
49 | if (boundary !== null) {
50 | contentType += '; boundary="' + boundary[1] + '"';
51 | }
52 | // Fix textarea.value EOL normalisation (multipart/form-data should use CR+NL, not NL)
53 | data = data.replace(/\n/g, '\r\n');
54 | }
55 | } else {
56 | contentType = form.attr('enctype') || form.attr('encoding')
57 |
58 | if (contentType === 'multipart/form-data') {
59 | if (!window.FormData) {
60 | alert('Your browser does not support AJAX multipart form submissions');
61 | return;
62 | }
63 |
64 | // Use the FormData API and allow the content type to be set automatically,
65 | // so it includes the boundary string.
66 | // See https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
67 | contentType = false;
68 | data = new FormData(form[0]);
69 | } else {
70 | contentType = 'application/x-www-form-urlencoded; charset=UTF-8'
71 | data = form.serialize();
72 | }
73 | }
74 |
75 | var ret = $.ajax({
76 | url: url,
77 | method: method,
78 | data: data,
79 | contentType: contentType,
80 | processData: false,
81 | headers: {
82 | 'Accept': 'text/html; q=1.0, */*'
83 | },
84 | });
85 |
86 | ret.always(function(data, textStatus, jqXHR) {
87 | if (textStatus != 'success') {
88 | jqXHR = data;
89 | }
90 |
91 | var responseContentType = jqXHR.getResponseHeader("content-type") || "";
92 |
93 | if (responseContentType.toLowerCase().indexOf('text/html') === 0) {
94 | replaceDocument(jqXHR.responseText);
95 |
96 | try {
97 | // Modify the location and scroll to top, as if after page load.
98 | history.replaceState({}, '', url);
99 | scroll(0, 0);
100 | } catch (err) {
101 | // History API not supported, so redirect.
102 | window.location = url;
103 | }
104 | } else {
105 | // Not HTML content. We can't open this directly, so redirect.
106 | window.location = url;
107 | }
108 | });
109 |
110 | return ret;
111 | }
112 |
113 | function captureSubmittingElement(e) {
114 | var target = e.target;
115 | var form = this;
116 |
117 | form.clk = target;
118 | }
119 |
120 | $.fn.ajaxForm = function() {
121 | var options = {}
122 |
123 | return this
124 | .unbind('submit.form-plugin click.form-plugin')
125 | .bind('submit.form-plugin', options, doAjaxSubmit)
126 | .bind('click.form-plugin', options, captureSubmittingElement);
127 | };
128 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/js/csrf.js:
--------------------------------------------------------------------------------
1 | function getCookie(name) {
2 | var cookieValue = null;
3 |
4 | if (document.cookie && document.cookie != '') {
5 | var cookies = document.cookie.split(';');
6 |
7 | for (var i = 0; i < cookies.length; i++) {
8 | var cookie = jQuery.trim(cookies[i]);
9 |
10 | // Does this cookie string begin with the name we want?
11 | if (cookie.substring(0, name.length + 1) == (name + '=')) {
12 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
13 | break;
14 | }
15 | }
16 | }
17 |
18 | return cookieValue;
19 | }
20 |
21 | function csrfSafeMethod(method) {
22 | // these HTTP methods do not require CSRF protection
23 | return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
24 | }
25 |
26 | function sameOrigin(url) {
27 | // test that a given url is a same-origin URL
28 | // url could be relative or scheme relative or absolute
29 | var host = document.location.host; // host + port
30 | var protocol = document.location.protocol;
31 | var sr_origin = '//' + host;
32 | var origin = protocol + sr_origin;
33 |
34 | // Allow absolute or scheme relative URLs to same origin
35 | return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
36 | (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
37 | // or any other URL that isn't scheme relative or absolute i.e relative.
38 | !(/^(\/\/|http:|https:).*/.test(url));
39 | }
40 |
41 | var csrftoken = window.drf.csrfToken;
42 |
43 | $.ajaxSetup({
44 | beforeSend: function(xhr, settings) {
45 | if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
46 | // Send the token to same-origin, relative URLs only.
47 | // Send the token only if the method warrants CSRF protection
48 | // Using the CSRFToken value acquired earlier
49 | xhr.setRequestHeader(window.drf.csrfHeaderName, csrftoken);
50 | }
51 | }
52 | });
53 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/js/default.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function() {
2 | // JSON highlighting.
3 | prettyPrint();
4 |
5 | // Bootstrap tooltips.
6 | $('.js-tooltip').tooltip({
7 | delay: 1000,
8 | container: 'body'
9 | });
10 |
11 | // Deal with rounded tab styling after tab clicks.
12 | $('a[data-toggle="tab"]:first').on('shown', function(e) {
13 | $(e.target).parents('.tabbable').addClass('first-tab-active');
14 | });
15 |
16 | $('a[data-toggle="tab"]:not(:first)').on('shown', function(e) {
17 | $(e.target).parents('.tabbable').removeClass('first-tab-active');
18 | });
19 |
20 | $('a[data-toggle="tab"]').click(function() {
21 | document.cookie = "tabstyle=" + this.name + "; path=/";
22 | });
23 |
24 | // Store tab preference in cookies & display appropriate tab on load.
25 | var selectedTab = null;
26 | var selectedTabName = getCookie('tabstyle');
27 |
28 | if (selectedTabName) {
29 | selectedTabName = selectedTabName.replace(/[^a-z-]/g, '');
30 | }
31 |
32 | if (selectedTabName) {
33 | selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
34 | }
35 |
36 | if (selectedTab && selectedTab.length > 0) {
37 | // Display whichever tab is selected.
38 | selectedTab.tab('show');
39 | } else {
40 | // If no tab selected, display rightmost tab.
41 | $('.form-switcher a:first').tab('show');
42 | }
43 |
44 | $(window).on('load', function() {
45 | $('#errorModal').modal('show');
46 | });
47 | });
48 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/status.py:
--------------------------------------------------------------------------------
1 | """
2 | Descriptive HTTP status codes, for code readability.
3 |
4 | See RFC 2616 - https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
5 | And RFC 6585 - https://tools.ietf.org/html/rfc6585
6 | And RFC 4918 - https://tools.ietf.org/html/rfc4918
7 | """
8 |
9 |
10 | def is_informational(code):
11 | return 100 <= code <= 199
12 |
13 |
14 | def is_success(code):
15 | return 200 <= code <= 299
16 |
17 |
18 | def is_redirect(code):
19 | return 300 <= code <= 399
20 |
21 |
22 | def is_client_error(code):
23 | return 400 <= code <= 499
24 |
25 |
26 | def is_server_error(code):
27 | return 500 <= code <= 599
28 |
29 |
30 | HTTP_100_CONTINUE = 100
31 | HTTP_101_SWITCHING_PROTOCOLS = 101
32 | HTTP_200_OK = 200
33 | HTTP_201_CREATED = 201
34 | HTTP_202_ACCEPTED = 202
35 | HTTP_203_NON_AUTHORITATIVE_INFORMATION = 203
36 | HTTP_204_NO_CONTENT = 204
37 | HTTP_205_RESET_CONTENT = 205
38 | HTTP_206_PARTIAL_CONTENT = 206
39 | HTTP_207_MULTI_STATUS = 207
40 | HTTP_208_ALREADY_REPORTED = 208
41 | HTTP_226_IM_USED = 226
42 | HTTP_300_MULTIPLE_CHOICES = 300
43 | HTTP_301_MOVED_PERMANENTLY = 301
44 | HTTP_302_FOUND = 302
45 | HTTP_303_SEE_OTHER = 303
46 | HTTP_304_NOT_MODIFIED = 304
47 | HTTP_305_USE_PROXY = 305
48 | HTTP_306_RESERVED = 306
49 | HTTP_307_TEMPORARY_REDIRECT = 307
50 | HTTP_308_PERMANENT_REDIRECT = 308
51 | HTTP_400_BAD_REQUEST = 400
52 | HTTP_401_UNAUTHORIZED = 401
53 | HTTP_402_PAYMENT_REQUIRED = 402
54 | HTTP_403_FORBIDDEN = 403
55 | HTTP_404_NOT_FOUND = 404
56 | HTTP_405_METHOD_NOT_ALLOWED = 405
57 | HTTP_406_NOT_ACCEPTABLE = 406
58 | HTTP_407_PROXY_AUTHENTICATION_REQUIRED = 407
59 | HTTP_408_REQUEST_TIMEOUT = 408
60 | HTTP_409_CONFLICT = 409
61 | HTTP_410_GONE = 410
62 | HTTP_411_LENGTH_REQUIRED = 411
63 | HTTP_412_PRECONDITION_FAILED = 412
64 | HTTP_413_REQUEST_ENTITY_TOO_LARGE = 413
65 | HTTP_414_REQUEST_URI_TOO_LONG = 414
66 | HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415
67 | HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416
68 | HTTP_417_EXPECTATION_FAILED = 417
69 | HTTP_418_IM_A_TEAPOT = 418
70 | HTTP_422_UNPROCESSABLE_ENTITY = 422
71 | HTTP_423_LOCKED = 423
72 | HTTP_424_FAILED_DEPENDENCY = 424
73 | HTTP_426_UPGRADE_REQUIRED = 426
74 | HTTP_428_PRECONDITION_REQUIRED = 428
75 | HTTP_429_TOO_MANY_REQUESTS = 429
76 | HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431
77 | HTTP_451_UNAVAILABLE_FOR_LEGAL_REASONS = 451
78 | HTTP_500_INTERNAL_SERVER_ERROR = 500
79 | HTTP_501_NOT_IMPLEMENTED = 501
80 | HTTP_502_BAD_GATEWAY = 502
81 | HTTP_503_SERVICE_UNAVAILABLE = 503
82 | HTTP_504_GATEWAY_TIMEOUT = 504
83 | HTTP_505_HTTP_VERSION_NOT_SUPPORTED = 505
84 | HTTP_506_VARIANT_ALSO_NEGOTIATES = 506
85 | HTTP_507_INSUFFICIENT_STORAGE = 507
86 | HTTP_508_LOOP_DETECTED = 508
87 | HTTP_509_BANDWIDTH_LIMIT_EXCEEDED = 509
88 | HTTP_510_NOT_EXTENDED = 510
89 | HTTP_511_NETWORK_AUTHENTICATION_REQUIRED = 511
90 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/admin/detail.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% for key, value in results|items %}
5 | {% if key in details %}
6 | {{ key|capfirst }} {{ value|format_value }}
7 | {% endif %}
8 | {% endfor %}
9 |
10 |
11 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/admin/dict_value.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% for k, v in value|items %}
5 |
6 | {{ k|format_value }}
7 | {{ v|format_value }}
8 |
9 | {% endfor %}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/admin/list.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% for column in columns%}{{ column|capfirst }} {% endfor %}
5 |
6 |
7 | {% for row in results %}
8 |
9 | {% for key, value in row|items %}
10 | {% if key in columns %}
11 |
12 | {{ value|format_value }}
13 |
14 | {% endif %}
15 | {% endfor %}
16 |
17 | {% if row.url %}
18 |
19 | {% else %}
20 |
21 | {% endif %}
22 |
23 |
24 | {% endfor %}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/admin/list_value.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% for item in value %}
5 |
6 | {{ forloop.counter0 }}
7 | {{ item|format_value }}
8 |
9 | {% endfor %}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/admin/simple_list_value.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% for item in value %}{% if not forloop.first%},{% endif %} {{item|format_value}}{% endfor %}
3 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/api.html:
--------------------------------------------------------------------------------
1 | {% extends "rest_framework/base.html" %}
2 |
3 | {# Override this template in your own templates directory to customize #}
4 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/auth/basic.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
39 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/auth/session.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
36 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/auth/token.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
37 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/document.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
5 |
{{ document.title }}
6 | {% if document.description %}
7 |
{% render_markdown document.description %}
8 | {% endif %}
9 |
10 |
11 | {% for html in lang_intro_htmls %}
12 | {% include html %}
13 | {% endfor %}
14 |
15 |
16 | {% if document|data %}
17 | {% for section_key, section in document|data|items %}
18 | {% if section_key %}
19 | {{ section_key }}
20 |
21 | {% endif %}
22 |
23 | {% for link_key, link in section|schema_links|items %}
24 | {% include "rest_framework/docs/link.html" %}
25 | {% endfor %}
26 | {% endfor %}
27 |
28 | {% for link_key, link in document.links|items %}
29 | {% include "rest_framework/docs/link.html" %}
30 | {% endfor %}
31 | {% endif %}
32 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/error.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Error Rendering Schema
10 |
11 |
12 |
13 |
14 |
15 | Error
16 |
17 |
18 | {{ data }}
19 |
20 |
21 |
22 | {% if debug is True %}
23 |
24 | Additional Information
25 | Note: You are seeing this message because DEBUG==True
.
26 |
27 | Seeing this page is usually a configuration error: are your
28 | DEFAULT_AUTHENTICATION_CLASSES
or DEFAULT_PERMISSION_CLASSES
29 | being applied unexpectedly?
30 |
31 | Your response status code is: {{ response.status_code }}
32 |
33 | 401 Unauthorised.
34 |
35 | Do you have SessionAuthentication enabled?
36 | Are you logged in?
37 |
38 |
39 |
40 | 403 Forbidden.
41 |
42 | Do you have sufficient permissions to access this view?
43 | Is you schema non-empty? (An empty schema will lead to a permission denied error being raised.)
44 |
45 |
46 |
47 | Most commonly the intended solution is to disable authentication and permissions
48 | when including the docs urls:
49 |
50 |
51 | url(r'^docs/', include_docs_urls(title='Your API',
52 | authentication_classes=[],
53 | permission_classes=[])),
54 |
55 |
56 |
57 | Overriding this template
58 |
59 | If you wish access to your docs to be authenticated you may override this template
60 | at rest_framework/docs/error.html
.
61 |
62 | The available context is: data
the error dict above, request
,
63 | response
and the debug
flag.
64 |
65 | {% endif %}
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/index.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{ document.title }}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {% if code_style %}{% endif %}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | {% include "rest_framework/docs/sidebar.html" %}
28 |
29 |
30 |
31 |
32 | {% include "rest_framework/docs/document.html" %}
33 |
34 |
35 |
36 |
37 | {% include "rest_framework/docs/auth/token.html" %}
38 | {% include "rest_framework/docs/auth/basic.html" %}
39 | {% include "rest_framework/docs/auth/session.html" %}
40 |
41 |
42 |
43 |
44 |
45 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/interact.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
52 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/javascript-intro.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% load static %}
3 | {% code html %}
4 |
5 | {% endcode %}
6 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/javascript.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% code javascript %}var coreapi = window.coreapi // Loaded by `coreapi.js`
3 | var schema = window.schema // Loaded by `schema.js`
4 |
5 | // Initialize a client
6 | var client = new coreapi.Client()
7 |
8 | // Interact with the API endpoint
9 | var action = [{% if section_key %}"{{ section_key }}", {% endif %}"{{ link_key }}"]
10 | {% if link.fields %}var params = {
11 | {% for field in link.fields %} {{ field.name }}: ...{% if not loop.last %},{% endif %}
12 | {% endfor %}}
13 | {% endif %}client.action(schema, action{% if link.fields %}, params{% endif %}).then(function(result) {
14 | // Return value is in 'result'
15 | }){% endcode %}
16 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/python-intro.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% code bash %}# Install the Python client library
3 | $ pip install coreapi{% endcode %}
4 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/python.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% code python %}import coreapi
3 |
4 | # Initialize a client & load the schema document
5 | client = coreapi.Client()
6 | schema = client.get("{{ document.url }}"{% if schema_format %}, format="{{ schema_format }}"{% endif %})
7 |
8 | # Interact with the API endpoint
9 | action = [{% if section_key %}"{{ section_key }}", {% endif %}"{{ link_key }}"]
10 | {% if link.fields %}params = {
11 | {% for field in link.fields %} "{{ field.name }}": ...{% if not loop.last %},{% endif %}
12 | {% endfor %}}
13 | {% endif %}result = client.action(schema, action{% if link.fields %}, params=params{% endif %}){% endcode %}
14 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/shell-intro.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% code bash %}# Install the command line client
3 | $ pip install coreapi-cli{% endcode %}
4 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/langs/shell.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% code bash %}# Load the schema document
3 | $ coreapi get {{ document.url }}{% if schema_format %} --format {{ schema_format }}{% endif %}
4 |
5 | # Interact with the API endpoint
6 | $ coreapi action {% if section_key %}{{ section_key }} {% endif %}{{ link_key|cut:"> " }}{% for field in link.fields %} -p {{ field.name }}=...{% endfor %}{% endcode %}
7 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/link.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 |
5 |
10 | Interact
11 |
12 |
13 |
{{ link.title|default:link_key }}
14 |
15 |
16 |
17 | {{ link.action|upper }}
18 | {{ link.url }}
19 |
20 |
21 |
{% render_markdown link.description %}
22 |
23 | {% if link.fields|with_location:'path' %}
24 |
Path Parameters
25 |
The following parameters should be included in the URL path.
26 |
27 |
28 | Parameter Description
29 |
30 |
31 | {% for field in link.fields|with_location:'path' %}
32 | {{ field.name }}
{% if field.required %} required {% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %}
33 | {% endfor %}
34 |
35 |
36 | {% endif %}
37 | {% if link.fields|with_location:'query' %}
38 |
Query Parameters
39 |
The following parameters should be included as part of a URL query string.
40 |
41 |
42 | Parameter Description
43 |
44 |
45 | {% for field in link.fields|with_location:'query' %}
46 | {{ field.name }}
{% if field.required %} required {% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %}
47 | {% endfor %}
48 |
49 |
50 | {% endif %}
51 | {% if link.fields|with_location:'header' %}
52 |
Header Parameters
53 |
The following parameters should be included as HTTP headers.
54 |
55 |
56 | Parameter Description
57 |
58 |
59 | {% for field in link.fields|with_location:'header' %}
60 | {{ field.name }}
{% if field.required %} required {% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %}
61 | {% endfor %}
62 |
63 |
64 | {% endif %}
65 | {% if link.fields|with_location:'body' %}
66 |
Request Body
67 |
The request body should be "{{ link.encoding }}"
encoded, and should contain a single item.
68 |
69 |
70 | Parameter Description
71 |
72 |
73 | {% for field in link.fields|with_location:'body' %}
74 | {{ field.name }}
{% if field.required %} required {% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %}
75 | {% endfor %}
76 |
77 |
78 | {% elif link.fields|with_location:'form' %}
79 |
Request Body
80 |
The request body should be a "{{ link.encoding }}"
encoded object, containing the following items.
81 |
82 |
83 | Parameter Description
84 |
85 |
86 | {% for field in link.fields|with_location:'form' %}
87 | {{ field.name }}
{% if field.required %} required {% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %}
88 | {% endfor %}
89 |
90 |
91 | {% endif %}
92 |
93 |
94 |
95 |
96 | {% for html in lang_htmls %}
97 | {% include html %}
98 | {% endfor %}
99 |
100 |
101 |
102 | {% include "rest_framework/docs/interact.html" with link=link %}
103 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/docs/sidebar.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
45 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/filters/base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 | {% for element in elements %}
10 | {% if not forloop.first %}
{% endif %}
11 | {{ element }}
12 | {% endfor %}
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/filters/ordering.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% load i18n %}
3 | {% trans "Ordering" %}
4 |
5 | {% for key, label in options %}
6 | {% if key == current %}
7 |
8 | {{ label }}
9 |
10 | {% else %}
11 |
{{ label }}
12 | {% endif %}
13 | {% endfor %}
14 |
15 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/filters/search.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% trans "Search" %}
3 |
13 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/checkbox.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
40 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/dict_field.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/fieldset.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 | {% if field.label %}
4 |
5 |
6 | {{ field.label }}
7 |
8 |
9 | {% endif %}
10 |
11 | {% for nested_field in field %}
12 | {% if not nested_field.read_only %}
13 | {% render_field nested_field style=style %}
14 | {% endif %}
15 | {% endfor %}
16 |
17 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/form.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% for field in form %}
3 | {% if not field.read_only %}
4 | {% render_field field style=style %}
5 | {% endif %}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/input.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/list_field.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/list_fieldset.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% if field.label %}
5 |
6 |
7 | {{ field.label }}
8 |
9 |
10 | {% endif %}
11 |
12 | Lists are not currently supported in HTML input.
13 |
14 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/radio.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 |
4 | {% trans "None" as none_choice %}
5 |
6 |
58 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/select.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
37 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/select_multiple.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 |
4 | {% trans "No items to select." as no_items %}
5 |
6 |
39 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/horizontal/textarea.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/checkbox.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/checkbox_multiple.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
17 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/dict_field.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/fieldset.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% for nested_field in field %}
3 | {% if not nested_field.read_only %}
4 | {% render_field nested_field style=style %}
5 | {% endif %}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/form.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% for field in form %}
3 | {% if not field.read_only %}
4 | {% render_field field style=style %}
5 | {% endif %}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/input.html:
--------------------------------------------------------------------------------
1 |
2 | {% if field.label %}
3 |
4 | {{ field.label }}
5 |
6 | {% endif %}
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/list_field.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/list_fieldset.html:
--------------------------------------------------------------------------------
1 | Lists are not currently supported in HTML input.
2 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/radio.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 | {% trans "None" as none_choice %}
4 |
5 |
30 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/select.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% if field.label %}
5 |
6 | {{ field.label }}
7 |
8 | {% endif %}
9 |
10 |
11 | {% if field.allow_null or field.allow_blank %}
12 | --------
13 | {% endif %}
14 | {% for select in field.iter_options %}
15 | {% if select.start_option_group %}
16 |
17 | {% elif select.end_option_group %}
18 |
19 | {% else %}
20 | {{ select.display_text }}
21 | {% endif %}
22 | {% endfor %}
23 |
24 |
25 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/select_multiple.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 | {% trans "No items to select." as no_items %}
4 |
5 |
6 | {% if field.label %}
7 |
8 | {{ field.label }}
9 |
10 | {% endif %}
11 |
12 |
13 | {% for select in field.iter_options %}
14 | {% if select.start_option_group %}
15 |
16 | {% elif select.end_option_group %}
17 |
18 | {% else %}
19 | {{ select.display_text }}
20 | {% endif %}
21 | {% empty %}
22 | {{ no_items }}
23 | {% endfor %}
24 |
25 |
26 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/inline/textarea.html:
--------------------------------------------------------------------------------
1 |
2 | {% if field.label %}
3 |
4 | {{ field.label }}
5 |
6 | {% endif %}
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/login.html:
--------------------------------------------------------------------------------
1 | {% extends "rest_framework/login_base.html" %}
2 |
3 | {# Override this template in your own templates directory to customize #}
4 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/login_base.html:
--------------------------------------------------------------------------------
1 | {% extends "rest_framework/base.html" %}
2 | {% load rest_framework %}
3 |
4 | {% block body %}
5 |
6 |
7 |
8 |
9 |
10 |
11 | {% block branding %}
Django REST framework {% endblock %}
12 |
13 |
14 |
15 |
61 |
62 |
63 |
64 |
65 | {% endblock %}
66 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/pagination/numbers.html:
--------------------------------------------------------------------------------
1 |
48 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/pagination/previous_and_next.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/raw_data_form.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {{ form.non_field_errors }}
3 | {% for field in form %}
4 |
11 | {% endfor %}
12 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/schema.js:
--------------------------------------------------------------------------------
1 | var codec = new window.coreapi.codecs.CoreJSONCodec()
2 | var coreJSON = window.atob('{{ schema }}')
3 | window.schema = codec.decode(coreJSON)
4 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/checkbox.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/checkbox_multiple.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
38 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/dict_field.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/fieldset.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% if field.label %}
5 |
6 | {{ field.label }}
7 |
8 | {% endif %}
9 |
10 | {% for nested_field in field %}
11 | {% if not nested_field.read_only %}
12 | {% render_field nested_field style=style %}
13 | {% endif %}
14 | {% endfor %}
15 |
16 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/form.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 | {% for field in form %}
3 | {% if not field.read_only %}
4 | {% render_field field style=style %}
5 | {% endif %}
6 | {% endfor %}
7 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/input.html:
--------------------------------------------------------------------------------
1 |
2 | {% if field.label %}
3 | {{ field.label }}
4 | {% endif %}
5 |
6 |
7 |
8 | {% if field.errors %}
9 | {% for error in field.errors %}
10 | {{ error }}
11 | {% endfor %}
12 | {% endif %}
13 |
14 | {% if field.help_text %}
15 | {{ field.help_text|safe }}
16 | {% endif %}
17 |
18 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/list_field.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/list_fieldset.html:
--------------------------------------------------------------------------------
1 |
2 | {% if field.label %}
3 |
4 | {{ field.label }}
5 |
6 | {% endif %}
7 |
8 | Lists are not currently supported in HTML input.
9 |
10 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/radio.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 | {% trans "None" as none_choice %}
4 |
5 |
58 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/select.html:
--------------------------------------------------------------------------------
1 | {% load rest_framework %}
2 |
3 |
4 | {% if field.label %}
5 |
6 | {{ field.label }}
7 |
8 | {% endif %}
9 |
10 |
11 | {% if field.allow_null or field.allow_blank %}
12 | --------
13 | {% endif %}
14 | {% for select in field.iter_options %}
15 | {% if select.start_option_group %}
16 |
17 | {% elif select.end_option_group %}
18 |
19 | {% else %}
20 | {{ select.display_text }}
21 | {% endif %}
22 | {% endfor %}
23 |
24 |
25 | {% if field.errors %}
26 | {% for error in field.errors %}
27 | {{ error }}
28 | {% endfor %}
29 | {% endif %}
30 |
31 | {% if field.help_text %}
32 | {{ field.help_text|safe }}
33 | {% endif %}
34 |
35 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/select_multiple.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% load rest_framework %}
3 | {% trans "No items to select." as no_items %}
4 |
5 |
6 | {% if field.label %}
7 |
8 | {{ field.label }}
9 |
10 | {% endif %}
11 |
12 |
13 | {% for select in field.iter_options %}
14 | {% if select.start_option_group %}
15 |
16 | {% elif select.end_option_group %}
17 |
18 | {% else %}
19 | {{ select.display_text }}
20 | {% endif %}
21 | {% empty %}
22 | {{ no_items }}
23 | {% endfor %}
24 |
25 |
26 | {% if field.errors %}
27 | {% for error in field.errors %}{{ error }} {% endfor %}
28 | {% endif %}
29 |
30 | {% if field.help_text %}
31 | {{ field.help_text|safe }}
32 | {% endif %}
33 |
34 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templates/rest_framework/vertical/textarea.html:
--------------------------------------------------------------------------------
1 |
2 | {% if field.label %}
3 |
4 | {{ field.label }}
5 |
6 | {% endif %}
7 |
8 |
9 |
10 | {% if field.errors %}
11 | {% for error in field.errors %}{{ error }} {% endfor %}
12 | {% endif %}
13 |
14 | {% if field.help_text %}
15 | {{ field.help_text|safe }}
16 | {% endif %}
17 |
18 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/templatetags/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/templatetags/__init__.py
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/urlpatterns.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls import include, url
2 |
3 | from rest_framework.compat import (
4 | URLResolver, get_regex_pattern, is_route_pattern, path, register_converter
5 | )
6 | from rest_framework.settings import api_settings
7 |
8 |
9 | def _get_format_path_converter(suffix_kwarg, allowed):
10 | if allowed:
11 | if len(allowed) == 1:
12 | allowed_pattern = allowed[0]
13 | else:
14 | allowed_pattern = '(?:%s)' % '|'.join(allowed)
15 | suffix_pattern = r"\.%s/?" % allowed_pattern
16 | else:
17 | suffix_pattern = r"\.[a-z0-9]+/?"
18 |
19 | class FormatSuffixConverter:
20 | regex = suffix_pattern
21 |
22 | def to_python(self, value):
23 | return value.strip('./')
24 |
25 | def to_url(self, value):
26 | return '.' + value + '/'
27 |
28 | converter_name = 'drf_format_suffix'
29 | if allowed:
30 | converter_name += '_' + '_'.join(allowed)
31 |
32 | return converter_name, FormatSuffixConverter
33 |
34 |
35 | def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required, suffix_route=None):
36 | ret = []
37 | for urlpattern in urlpatterns:
38 | if isinstance(urlpattern, URLResolver):
39 | # Set of included URL patterns
40 | regex = get_regex_pattern(urlpattern)
41 | namespace = urlpattern.namespace
42 | app_name = urlpattern.app_name
43 | kwargs = urlpattern.default_kwargs
44 | # Add in the included patterns, after applying the suffixes
45 | patterns = apply_suffix_patterns(urlpattern.url_patterns,
46 | suffix_pattern,
47 | suffix_required,
48 | suffix_route)
49 |
50 | # if the original pattern was a RoutePattern we need to preserve it
51 | if is_route_pattern(urlpattern):
52 | assert path is not None
53 | route = str(urlpattern.pattern)
54 | new_pattern = path(route, include((patterns, app_name), namespace), kwargs)
55 | else:
56 | new_pattern = url(regex, include((patterns, app_name), namespace), kwargs)
57 |
58 | ret.append(new_pattern)
59 | else:
60 | # Regular URL pattern
61 | regex = get_regex_pattern(urlpattern).rstrip('$').rstrip('/') + suffix_pattern
62 | view = urlpattern.callback
63 | kwargs = urlpattern.default_args
64 | name = urlpattern.name
65 | # Add in both the existing and the new urlpattern
66 | if not suffix_required:
67 | ret.append(urlpattern)
68 |
69 | # if the original pattern was a RoutePattern we need to preserve it
70 | if is_route_pattern(urlpattern):
71 | assert path is not None
72 | assert suffix_route is not None
73 | route = str(urlpattern.pattern).rstrip('$').rstrip('/') + suffix_route
74 | new_pattern = path(route, view, kwargs, name)
75 | else:
76 | new_pattern = url(regex, view, kwargs, name)
77 |
78 | ret.append(new_pattern)
79 |
80 | return ret
81 |
82 |
83 | def format_suffix_patterns(urlpatterns, suffix_required=False, allowed=None):
84 | """
85 | Supplement existing urlpatterns with corresponding patterns that also
86 | include a '.format' suffix. Retains urlpattern ordering.
87 |
88 | urlpatterns:
89 | A list of URL patterns.
90 |
91 | suffix_required:
92 | If `True`, only suffixed URLs will be generated, and non-suffixed
93 | URLs will not be used. Defaults to `False`.
94 |
95 | allowed:
96 | An optional tuple/list of allowed suffixes. eg ['json', 'api']
97 | Defaults to `None`, which allows any suffix.
98 | """
99 | suffix_kwarg = api_settings.FORMAT_SUFFIX_KWARG
100 | if allowed:
101 | if len(allowed) == 1:
102 | allowed_pattern = allowed[0]
103 | else:
104 | allowed_pattern = '(%s)' % '|'.join(allowed)
105 | suffix_pattern = r'\.(?P<%s>%s)/?$' % (suffix_kwarg, allowed_pattern)
106 | else:
107 | suffix_pattern = r'\.(?P<%s>[a-z0-9]+)/?$' % suffix_kwarg
108 |
109 | if path and register_converter:
110 | converter_name, suffix_converter = _get_format_path_converter(suffix_kwarg, allowed)
111 | register_converter(suffix_converter, converter_name)
112 |
113 | suffix_route = '<%s:%s>' % (converter_name, suffix_kwarg)
114 | else:
115 | suffix_route = None
116 |
117 | return apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required, suffix_route)
118 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/urls.py:
--------------------------------------------------------------------------------
1 | """
2 | Login and logout views for the browsable API.
3 |
4 | Add these to your root URLconf if you're using the browsable API and
5 | your API requires authentication:
6 |
7 | urlpatterns = [
8 | ...
9 | url(r'^auth/', include('rest_framework.urls'))
10 | ]
11 |
12 | You should make sure your authentication settings include `SessionAuthentication`.
13 | """
14 | from django.conf.urls import url
15 | from django.contrib.auth import views
16 |
17 | app_name = 'rest_framework'
18 | urlpatterns = [
19 | url(r'^login/$', views.LoginView.as_view(template_name='rest_framework/login.html'), name='login'),
20 | url(r'^logout/$', views.LogoutView.as_view(), name='logout'),
21 | ]
22 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/utils/__init__.py
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/breadcrumbs.py:
--------------------------------------------------------------------------------
1 | from django.urls import get_script_prefix, resolve
2 |
3 |
4 | def get_breadcrumbs(url, request=None):
5 | """
6 | Given a url returns a list of breadcrumbs, which are each a
7 | tuple of (name, url).
8 | """
9 | from rest_framework.reverse import preserve_builtin_query_params
10 | from rest_framework.views import APIView
11 |
12 | def breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen):
13 | """
14 | Add tuples of (name, url) to the breadcrumbs list,
15 | progressively chomping off parts of the url.
16 | """
17 | try:
18 | (view, unused_args, unused_kwargs) = resolve(url)
19 | except Exception:
20 | pass
21 | else:
22 | # Check if this is a REST framework view,
23 | # and if so add it to the breadcrumbs
24 | cls = getattr(view, 'cls', None)
25 | initkwargs = getattr(view, 'initkwargs', {})
26 | if cls is not None and issubclass(cls, APIView):
27 | # Don't list the same view twice in a row.
28 | # Probably an optional trailing slash.
29 | if not seen or seen[-1] != view:
30 | c = cls(**initkwargs)
31 | name = c.get_view_name()
32 | insert_url = preserve_builtin_query_params(prefix + url, request)
33 | breadcrumbs_list.insert(0, (name, insert_url))
34 | seen.append(view)
35 |
36 | if url == '':
37 | # All done
38 | return breadcrumbs_list
39 |
40 | elif url.endswith('/'):
41 | # Drop trailing slash off the end and continue to try to
42 | # resolve more breadcrumbs
43 | url = url.rstrip('/')
44 | return breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen)
45 |
46 | # Drop trailing non-slash off the end and continue to try to
47 | # resolve more breadcrumbs
48 | url = url[:url.rfind('/') + 1]
49 | return breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen)
50 |
51 | prefix = get_script_prefix().rstrip('/')
52 | url = url[len(prefix):]
53 | return breadcrumbs_recursive(url, [], prefix, [])
54 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/encoders.py:
--------------------------------------------------------------------------------
1 | """
2 | Helper classes for parsers.
3 | """
4 | import datetime
5 | import decimal
6 | import json # noqa
7 | import uuid
8 |
9 | from django.db.models.query import QuerySet
10 | from django.utils import timezone
11 | from django.utils.encoding import force_str
12 | from django.utils.functional import Promise
13 |
14 | from rest_framework.compat import coreapi
15 |
16 |
17 | class JSONEncoder(json.JSONEncoder):
18 | """
19 | JSONEncoder subclass that knows how to encode date/time/timedelta,
20 | decimal types, generators and other basic python objects.
21 | """
22 | def default(self, obj):
23 | # For Date Time string spec, see ECMA 262
24 | # https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
25 | if isinstance(obj, Promise):
26 | return force_str(obj)
27 | elif isinstance(obj, datetime.datetime):
28 | representation = obj.isoformat()
29 | if representation.endswith('+00:00'):
30 | representation = representation[:-6] + 'Z'
31 | return representation
32 | elif isinstance(obj, datetime.date):
33 | return obj.isoformat()
34 | elif isinstance(obj, datetime.time):
35 | if timezone and timezone.is_aware(obj):
36 | raise ValueError("JSON can't represent timezone-aware times.")
37 | representation = obj.isoformat()
38 | return representation
39 | elif isinstance(obj, datetime.timedelta):
40 | return str(obj.total_seconds())
41 | elif isinstance(obj, decimal.Decimal):
42 | # Serializers will coerce decimals to strings by default.
43 | return float(obj)
44 | elif isinstance(obj, uuid.UUID):
45 | return str(obj)
46 | elif isinstance(obj, QuerySet):
47 | return tuple(obj)
48 | elif isinstance(obj, bytes):
49 | # Best-effort for binary blobs. See #4187.
50 | return obj.decode()
51 | elif hasattr(obj, 'tolist'):
52 | # Numpy arrays and array scalars.
53 | return obj.tolist()
54 | elif (coreapi is not None) and isinstance(obj, (coreapi.Document, coreapi.Error)):
55 | raise RuntimeError(
56 | 'Cannot return a coreapi object from a JSON view. '
57 | 'You should be using a schema renderer instead for this view.'
58 | )
59 | elif hasattr(obj, '__getitem__'):
60 | cls = (list if isinstance(obj, (list, tuple)) else dict)
61 | try:
62 | return cls(obj)
63 | except Exception:
64 | pass
65 | elif hasattr(obj, '__iter__'):
66 | return tuple(item for item in obj)
67 | return super().default(obj)
68 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/formatting.py:
--------------------------------------------------------------------------------
1 | """
2 | Utility functions to return a formatted name and description for a given view.
3 | """
4 | import re
5 |
6 | from django.utils.encoding import force_str
7 | from django.utils.html import escape
8 | from django.utils.safestring import mark_safe
9 |
10 | from rest_framework.compat import apply_markdown
11 |
12 |
13 | def remove_trailing_string(content, trailing):
14 | """
15 | Strip trailing component `trailing` from `content` if it exists.
16 | Used when generating names from view classes.
17 | """
18 | if content.endswith(trailing) and content != trailing:
19 | return content[:-len(trailing)]
20 | return content
21 |
22 |
23 | def dedent(content):
24 | """
25 | Remove leading indent from a block of text.
26 | Used when generating descriptions from docstrings.
27 |
28 | Note that python's `textwrap.dedent` doesn't quite cut it,
29 | as it fails to dedent multiline docstrings that include
30 | unindented text on the initial line.
31 | """
32 | content = force_str(content)
33 | lines = [line for line in content.splitlines()[1:] if line.lstrip()]
34 |
35 | # unindent the content if needed
36 | if lines:
37 | whitespace_counts = min([len(line) - len(line.lstrip(' ')) for line in lines])
38 | tab_counts = min([len(line) - len(line.lstrip('\t')) for line in lines])
39 | if whitespace_counts:
40 | whitespace_pattern = '^' + (' ' * whitespace_counts)
41 | content = re.sub(re.compile(whitespace_pattern, re.MULTILINE), '', content)
42 | elif tab_counts:
43 | whitespace_pattern = '^' + ('\t' * tab_counts)
44 | content = re.sub(re.compile(whitespace_pattern, re.MULTILINE), '', content)
45 | return content.strip()
46 |
47 |
48 | def camelcase_to_spaces(content):
49 | """
50 | Translate 'CamelCaseNames' to 'Camel Case Names'.
51 | Used when generating names from view classes.
52 | """
53 | camelcase_boundary = '(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))'
54 | content = re.sub(camelcase_boundary, ' \\1', content).strip()
55 | return ' '.join(content.split('_')).title()
56 |
57 |
58 | def markup_description(description):
59 | """
60 | Apply HTML markup to the given description.
61 | """
62 | if apply_markdown:
63 | description = apply_markdown(description)
64 | else:
65 | description = escape(description).replace('\n', ' ')
66 | description = '' + description + '
'
67 | return mark_safe(description)
68 |
69 |
70 | class lazy_format:
71 | """
72 | Delay formatting until it's actually needed.
73 |
74 | Useful when the format string or one of the arguments is lazy.
75 |
76 | Not using Django's lazy because it is too slow.
77 | """
78 | __slots__ = ('format_string', 'args', 'kwargs', 'result')
79 |
80 | def __init__(self, format_string, *args, **kwargs):
81 | self.result = None
82 | self.format_string = format_string
83 | self.args = args
84 | self.kwargs = kwargs
85 |
86 | def __str__(self):
87 | if self.result is None:
88 | self.result = self.format_string.format(*self.args, **self.kwargs)
89 | self.format_string, self.args, self.kwargs = None, None, None
90 | return self.result
91 |
92 | def __mod__(self, value):
93 | return str(self) % value
94 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/html.py:
--------------------------------------------------------------------------------
1 | """
2 | Helpers for dealing with HTML input.
3 | """
4 | import re
5 |
6 | from django.utils.datastructures import MultiValueDict
7 |
8 |
9 | def is_html_input(dictionary):
10 | # MultiDict type datastructures are used to represent HTML form input,
11 | # which may have more than one value for each key.
12 | return hasattr(dictionary, 'getlist')
13 |
14 |
15 | def parse_html_list(dictionary, prefix='', default=None):
16 | """
17 | Used to support list values in HTML forms.
18 | Supports lists of primitives and/or dictionaries.
19 |
20 | * List of primitives.
21 |
22 | {
23 | '[0]': 'abc',
24 | '[1]': 'def',
25 | '[2]': 'hij'
26 | }
27 | -->
28 | [
29 | 'abc',
30 | 'def',
31 | 'hij'
32 | ]
33 |
34 | * List of dictionaries.
35 |
36 | {
37 | '[0]foo': 'abc',
38 | '[0]bar': 'def',
39 | '[1]foo': 'hij',
40 | '[1]bar': 'klm',
41 | }
42 | -->
43 | [
44 | {'foo': 'abc', 'bar': 'def'},
45 | {'foo': 'hij', 'bar': 'klm'}
46 | ]
47 |
48 | :returns a list of objects, or the value specified in ``default`` if the list is empty
49 | """
50 | ret = {}
51 | regex = re.compile(r'^%s\[([0-9]+)\](.*)$' % re.escape(prefix))
52 | for field, value in dictionary.items():
53 | match = regex.match(field)
54 | if not match:
55 | continue
56 | index, key = match.groups()
57 | index = int(index)
58 | if not key:
59 | ret[index] = value
60 | elif isinstance(ret.get(index), dict):
61 | ret[index][key] = value
62 | else:
63 | ret[index] = MultiValueDict({key: [value]})
64 |
65 | # return the items of the ``ret`` dict, sorted by key, or ``default`` if the dict is empty
66 | return [ret[item] for item in sorted(ret)] if ret else default
67 |
68 |
69 | def parse_html_dict(dictionary, prefix=''):
70 | """
71 | Used to support dictionary values in HTML forms.
72 |
73 | {
74 | 'profile.username': 'example',
75 | 'profile.email': 'example@example.com',
76 | }
77 | -->
78 | {
79 | 'profile': {
80 | 'username': 'example',
81 | 'email': 'example@example.com'
82 | }
83 | }
84 | """
85 | ret = MultiValueDict()
86 | regex = re.compile(r'^%s\.(.+)$' % re.escape(prefix))
87 | for field in dictionary:
88 | match = regex.match(field)
89 | if not match:
90 | continue
91 | key = match.groups()[0]
92 | value = dictionary.getlist(field)
93 | ret.setlist(key, value)
94 |
95 | return ret
96 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/humanize_datetime.py:
--------------------------------------------------------------------------------
1 | """
2 | Helper functions that convert strftime formats into more readable representations.
3 | """
4 | from rest_framework import ISO_8601
5 |
6 |
7 | def datetime_formats(formats):
8 | format = ', '.join(formats).replace(
9 | ISO_8601,
10 | 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'
11 | )
12 | return humanize_strptime(format)
13 |
14 |
15 | def date_formats(formats):
16 | format = ', '.join(formats).replace(ISO_8601, 'YYYY-MM-DD')
17 | return humanize_strptime(format)
18 |
19 |
20 | def time_formats(formats):
21 | format = ', '.join(formats).replace(ISO_8601, 'hh:mm[:ss[.uuuuuu]]')
22 | return humanize_strptime(format)
23 |
24 |
25 | def humanize_strptime(format_string):
26 | # Note that we're missing some of the locale specific mappings that
27 | # don't really make sense.
28 | mapping = {
29 | "%Y": "YYYY",
30 | "%y": "YY",
31 | "%m": "MM",
32 | "%b": "[Jan-Dec]",
33 | "%B": "[January-December]",
34 | "%d": "DD",
35 | "%H": "hh",
36 | "%I": "hh", # Requires '%p' to differentiate from '%H'.
37 | "%M": "mm",
38 | "%S": "ss",
39 | "%f": "uuuuuu",
40 | "%a": "[Mon-Sun]",
41 | "%A": "[Monday-Sunday]",
42 | "%p": "[AM|PM]",
43 | "%z": "[+HHMM|-HHMM]"
44 | }
45 | for key, val in mapping.items():
46 | format_string = format_string.replace(key, val)
47 | return format_string
48 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/json.py:
--------------------------------------------------------------------------------
1 | """
2 | Wrapper for the builtin json module that ensures compliance with the JSON spec.
3 |
4 | REST framework should always import this wrapper module in order to maintain
5 | spec-compliant encoding/decoding. Support for non-standard features should be
6 | handled by users at the renderer and parser layer.
7 | """
8 | import functools
9 | import json # noqa
10 |
11 |
12 | def strict_constant(o):
13 | raise ValueError('Out of range float values are not JSON compliant: ' + repr(o))
14 |
15 |
16 | @functools.wraps(json.dump)
17 | def dump(*args, **kwargs):
18 | kwargs.setdefault('allow_nan', False)
19 | return json.dump(*args, **kwargs)
20 |
21 |
22 | @functools.wraps(json.dumps)
23 | def dumps(*args, **kwargs):
24 | kwargs.setdefault('allow_nan', False)
25 | return json.dumps(*args, **kwargs)
26 |
27 |
28 | @functools.wraps(json.load)
29 | def load(*args, **kwargs):
30 | kwargs.setdefault('parse_constant', strict_constant)
31 | return json.load(*args, **kwargs)
32 |
33 |
34 | @functools.wraps(json.loads)
35 | def loads(*args, **kwargs):
36 | kwargs.setdefault('parse_constant', strict_constant)
37 | return json.loads(*args, **kwargs)
38 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/mediatypes.py:
--------------------------------------------------------------------------------
1 | """
2 | Handling of media types, as found in HTTP Content-Type and Accept headers.
3 |
4 | See https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
5 | """
6 | from django.http.multipartparser import parse_header
7 |
8 | from rest_framework import HTTP_HEADER_ENCODING
9 |
10 |
11 | def media_type_matches(lhs, rhs):
12 | """
13 | Returns ``True`` if the media type in the first argument <= the
14 | media type in the second argument. The media types are strings
15 | as described by the HTTP spec.
16 |
17 | Valid media type strings include:
18 |
19 | 'application/json; indent=4'
20 | 'application/json'
21 | 'text/*'
22 | '*/*'
23 | """
24 | lhs = _MediaType(lhs)
25 | rhs = _MediaType(rhs)
26 | return lhs.match(rhs)
27 |
28 |
29 | def order_by_precedence(media_type_lst):
30 | """
31 | Returns a list of sets of media type strings, ordered by precedence.
32 | Precedence is determined by how specific a media type is:
33 |
34 | 3. 'type/subtype; param=val'
35 | 2. 'type/subtype'
36 | 1. 'type/*'
37 | 0. '*/*'
38 | """
39 | ret = [set(), set(), set(), set()]
40 | for media_type in media_type_lst:
41 | precedence = _MediaType(media_type).precedence
42 | ret[3 - precedence].add(media_type)
43 | return [media_types for media_types in ret if media_types]
44 |
45 |
46 | class _MediaType:
47 | def __init__(self, media_type_str):
48 | self.orig = '' if (media_type_str is None) else media_type_str
49 | self.full_type, self.params = parse_header(self.orig.encode(HTTP_HEADER_ENCODING))
50 | self.main_type, sep, self.sub_type = self.full_type.partition('/')
51 |
52 | def match(self, other):
53 | """Return true if this MediaType satisfies the given MediaType."""
54 | for key in self.params:
55 | if key != 'q' and other.params.get(key, None) != self.params.get(key, None):
56 | return False
57 |
58 | if self.sub_type != '*' and other.sub_type != '*' and other.sub_type != self.sub_type:
59 | return False
60 |
61 | if self.main_type != '*' and other.main_type != '*' and other.main_type != self.main_type:
62 | return False
63 |
64 | return True
65 |
66 | @property
67 | def precedence(self):
68 | """
69 | Return a precedence level from 0-3 for the media type given how specific it is.
70 | """
71 | if self.main_type == '*':
72 | return 0
73 | elif self.sub_type == '*':
74 | return 1
75 | elif not self.params or list(self.params) == ['q']:
76 | return 2
77 | return 3
78 |
79 | def __str__(self):
80 | ret = "%s/%s" % (self.main_type, self.sub_type)
81 | for key, val in self.params.items():
82 | ret += "; %s=%s" % (key, val.decode('ascii'))
83 | return ret
84 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/representation.py:
--------------------------------------------------------------------------------
1 | """
2 | Helper functions for creating user-friendly representations
3 | of serializer classes and serializer fields.
4 | """
5 | import re
6 |
7 | from django.db import models
8 | from django.utils.encoding import force_str
9 | from django.utils.functional import Promise
10 |
11 |
12 | def manager_repr(value):
13 | model = value.model
14 | opts = model._meta
15 | names_and_managers = [
16 | (manager.name, manager)
17 | for manager
18 | in opts.managers
19 | ]
20 | for manager_name, manager_instance in names_and_managers:
21 | if manager_instance == value:
22 | return '%s.%s.all()' % (model._meta.object_name, manager_name)
23 | return repr(value)
24 |
25 |
26 | def smart_repr(value):
27 | if isinstance(value, models.Manager):
28 | return manager_repr(value)
29 |
30 | if isinstance(value, Promise) and value._delegate_text:
31 | value = force_str(value)
32 |
33 | value = repr(value)
34 |
35 | # Representations like u'help text'
36 | # should simply be presented as 'help text'
37 | if value.startswith("u'") and value.endswith("'"):
38 | return value[1:]
39 |
40 | # Representations like
41 | #
42 | # Should be presented as
43 | #
44 | return re.sub(' at 0x[0-9A-Fa-f]{4,32}>', '>', value)
45 |
46 |
47 | def field_repr(field, force_many=False):
48 | kwargs = field._kwargs
49 | if force_many:
50 | kwargs = kwargs.copy()
51 | kwargs['many'] = True
52 | kwargs.pop('child', None)
53 |
54 | arg_string = ', '.join([smart_repr(val) for val in field._args])
55 | kwarg_string = ', '.join([
56 | '%s=%s' % (key, smart_repr(val))
57 | for key, val in sorted(kwargs.items())
58 | ])
59 | if arg_string and kwarg_string:
60 | arg_string += ', '
61 |
62 | if force_many:
63 | class_name = force_many.__class__.__name__
64 | else:
65 | class_name = field.__class__.__name__
66 |
67 | return "%s(%s%s)" % (class_name, arg_string, kwarg_string)
68 |
69 |
70 | def serializer_repr(serializer, indent, force_many=None):
71 | ret = field_repr(serializer, force_many) + ':'
72 | indent_str = ' ' * indent
73 |
74 | if force_many:
75 | fields = force_many.fields
76 | else:
77 | fields = serializer.fields
78 |
79 | for field_name, field in fields.items():
80 | ret += '\n' + indent_str + field_name + ' = '
81 | if hasattr(field, 'fields'):
82 | ret += serializer_repr(field, indent + 1)
83 | elif hasattr(field, 'child'):
84 | ret += list_repr(field, indent + 1)
85 | elif hasattr(field, 'child_relation'):
86 | ret += field_repr(field.child_relation, force_many=field.child_relation)
87 | else:
88 | ret += field_repr(field)
89 |
90 | if serializer.validators:
91 | ret += '\n' + indent_str + 'class Meta:'
92 | ret += '\n' + indent_str + ' validators = ' + smart_repr(serializer.validators)
93 |
94 | return ret
95 |
96 |
97 | def list_repr(serializer, indent):
98 | child = serializer.child
99 | if hasattr(child, 'fields'):
100 | return serializer_repr(serializer, indent, force_many=child)
101 | return field_repr(serializer)
102 |
--------------------------------------------------------------------------------
/venv/lib/python3.7/site-packages/rest_framework/utils/urls.py:
--------------------------------------------------------------------------------
1 | from urllib import parse
2 |
3 | from django.utils.encoding import force_str
4 |
5 |
6 | def replace_query_param(url, key, val):
7 | """
8 | Given a URL and a key/val pair, set or replace an item in the query
9 | parameters of the URL, and return the new URL.
10 | """
11 | (scheme, netloc, path, query, fragment) = parse.urlsplit(force_str(url))
12 | query_dict = parse.parse_qs(query, keep_blank_values=True)
13 | query_dict[force_str(key)] = [force_str(val)]
14 | query = parse.urlencode(sorted(list(query_dict.items())), doseq=True)
15 | return parse.urlunsplit((scheme, netloc, path, query, fragment))
16 |
17 |
18 | def remove_query_param(url, key):
19 | """
20 | Given a URL and a key/val pair, remove an item in the query
21 | parameters of the URL, and return the new URL.
22 | """
23 | (scheme, netloc, path, query, fragment) = parse.urlsplit(force_str(url))
24 | query_dict = parse.parse_qs(query, keep_blank_values=True)
25 | query_dict.pop(key, None)
26 | query = parse.urlencode(sorted(list(query_dict.items())), doseq=True)
27 | return parse.urlunsplit((scheme, netloc, path, query, fragment))
28 |
--------------------------------------------------------------------------------