{"id":745,"date":"2017-04-29T16:53:57","date_gmt":"2017-04-29T08:53:57","guid":{"rendered":"http:\/\/192.168.1.20\/?p=745"},"modified":"2017-10-23T11:52:47","modified_gmt":"2017-10-23T03:52:47","slug":"django{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}e7{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}9f{47dd41ec6bdcbd9a214c783a3735392b82ea6d1d918378c5a53e06407","status":"publish","type":"post","link":"http:\/\/alextop.top\/?p=745","title":{"rendered":"Django\u77e5\u8bc6"},"content":{"rendered":"<p style=\"margin-left: 15pt;\"><span style=\"color: navy;\"><strong><span style=\"font-family: Consolas;\">Form.is_vaild<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u4f5c\u7528<\/span><span style=\"font-family: Consolas;\">:<br \/>\n<\/span><\/strong><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy;\"><strong><span style=\"font-family: \u5b8b\u4f53;\">\u9a8c\u8bc1<\/span><span style=\"font-family: Consolas;\">post<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u8fc7\u6765\u7684\u6570\u636e\u7684\u683c\u5f0f<\/span><span style=\"font-family: Consolas;\"><br \/>\n<\/span><\/strong><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy;\"><strong><span style=\"font-family: \u5b8b\u4f53;\">\u540c\u65f6\u8fd4\u56de<\/span><span style=\"font-family: Consolas;\">False<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u548c<\/span><span style=\"font-family: Consolas;\">Ture<br \/>\n<\/span><\/strong><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy;\"><strong><span style=\"font-family: \u5b8b\u4f53;\">\u4ee5\u4e0b\u6458\u81ea<\/span><span style=\"font-family: Consolas;\">django<\/span><span style=\"font-family: \u5b8b\u4f53;\">\u5b98\u65b9\u6587\u6863<\/span><span style=\"font-family: Consolas;\"><br \/>\n<\/span><\/strong><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy; font-family: Consolas;\"><strong>&gt;&gt;&gt; <\/strong><span style=\"color: #0c4b33;\">data <span style=\"color: #666666;\">=<span style=\"color: #0c4b33;\"> {<\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-TOTAL_FORMS&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8216;2&#8217;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-INITIAL_FORMS&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8216;0&#8217;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-MAX_NUM_FORMS&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8221;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-0-title&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8216;Test&#8217;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><strong>\u00a0<\/strong><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-0-pub_date&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8216;1904-06-16&#8217;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-1-title&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8216;Test&#8217;<span style=\"color: #0c4b33;\">,<\/span><\/span><\/span><\/span><\/span><\/span><span style=\"color: navy; font-family: Consolas;\"><span style=\"color: #0c4b33;\"><br \/>\n<span style=\"color: #ba2121;\">&#8216;form-1-pub_date&#8217;<span style=\"color: #0c4b33;\">: <span style=\"color: #ba2121;\">&#8221;<span style=\"color: #0c4b33;\">, <span style=\"color: #408080;\"><em># &lt;&#8211; this date is missing but required<\/em><span style=\"color: #0c4b33;\"><br \/>\n<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy; font-family: Consolas;\"><strong>&#8230; <\/strong><span style=\"color: #0c4b33;\">}<br \/>\n<\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy; font-family: Consolas;\"><strong>&gt;&gt;&gt; <\/strong><span style=\"color: #0c4b33;\">formset <span style=\"color: #666666;\">=<span style=\"color: #0c4b33;\"> ArticleFormSet(data)<br \/>\n<\/span><\/span><\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy; font-family: Consolas;\"><strong>&gt;&gt;&gt; <\/strong><span style=\"color: #0c4b33;\">formset<span style=\"color: #666666;\">.<span style=\"color: #0c4b33;\">is_valid()<br \/>\n<\/span><\/span><\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: gray; font-family: Consolas;\">False<span style=\"color: #0c4b33;\"><br \/>\n<\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: navy; font-family: Consolas;\"><strong>&gt;&gt;&gt; <\/strong><span style=\"color: #0c4b33;\">formset<span style=\"color: #666666;\">.<span style=\"color: #0c4b33;\">errors<br \/>\n<\/span><\/span><\/span><\/span><\/p>\n<p style=\"margin-left: 15pt;\"><span style=\"color: gray; font-family: Consolas;\">[{}, {&#8216;pub_date&#8217;: [&#8216;This field is required.&#8217;]}]<span style=\"color: #0c4b33;\"><br \/>\n<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Form.is_vaild\u4f5c\u7528&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,10],"tags":[],"class_list":["post-745","post","type-post","status-publish","format-standard","hentry","category-python","category-jishu"],"_links":{"self":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/745"}],"collection":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=745"}],"version-history":[{"count":1,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":982,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/745\/revisions\/982"}],"wp:attachment":[{"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}