{"id":110393,"date":"2020-05-08T09:07:36","date_gmt":"2020-05-08T01:07:36","guid":{"rendered":"http:\/\/4563.org\/?p=110393"},"modified":"2020-05-08T09:07:36","modified_gmt":"2020-05-08T01:07:36","slug":"%e5%b0%8f%e7%99%bd%e6%b1%82%e5%8a%a9%ef%bc%8c-flask_sqlalchemy-%e6%9d%a1%e4%bb%b6%e6%9f%a5%e8%af%a2%e7%9a%84%e4%b8%80%e4%b8%aa%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=110393","title":{"rendered":"\u5c0f\u767d\u6c42\u52a9\uff0c flask_sqlalchemy \u6761\u4ef6\u67e5\u8be2\u7684\u4e00\u4e2a\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5c0f\u767d\u6c42\u52a9\uff0c flask_sqlalchemy \u6761\u4ef6\u67e5\u8be2\u7684\u4e00\u4e2a\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hosinokamui <\/span>  <span><i><\/i> 65<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u5982\u679c\u6761\u4ef6\u4e3a None\uff0c\u600e\u6837\u80fd\u8fd4\u56de\u6240\u6709\u7684\u6570\u636e\u5462\uff0c\u73b0\u5728\u662f\u76f4\u63a5\u5728 sql \u91cc\u53d8\u6210\u201cwhere \u5b57\u6bb5 IS NULL\u201d\u4e86      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"611119\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : knightdf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`python<br \/>filters = []<br \/>if xxx is not None:<br \/> filters.append(Model.attr == xxx)<br \/>.query.filter(*filters).xxxx<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"611120\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hp66722667 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u901a\u8fc7 if \u5224\u65ad\u4e00\u4e0b\u5b57\u6bb5\uff0c\u4e0d\u5c31\u53ef\u4ee5\u968f\u4fbf\u62fc\u63a5 sql \u8bed\u53e5\u4e86\u4e48                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"611121\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 6167 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`<br \/>if not xxx:<br \/> data = Xxx.query.all()<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"611122\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SjwNo1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u90fd\u7528 SQLAlchemy \u4e86~~<br \/>&#8221;&#8217;<br \/>if cond is None:<br \/> objs = Xxx.query.all()<br \/>&#8221;&#8217;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u767d\u6c42\u52a9\uff0c flask_sqlal&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/110393"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=110393"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/110393\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=110393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=110393"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=110393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}