小编rho*_*rho的帖子

sqlalchemy 未对架构执行注释

我不确定为什么对模式的评论不能通过 sqlalchemy 工作,\n但在 psql 控制台上工作得很好,

\n\n

尝试了各种设置仍然没有成功,创建了架构但无法添加描述。

\n\n
import sqlalchemy\n\nengine = sqlalchemy.create_engine(\'postgresql://postgres@localhost/posgres\')\nengine.execute("CREATE SCHEMA IF NOT EXISTS myschema")\nengine.execute("COMMENT ON SCHEMA myschema IS \'Seemly Random Description\'")\n
Run Code Online (Sandbox Code Playgroud)\n\n

使用 psql 检查

\n\n
postgres=# \\dn+\n                           List of schemas\n   Name   \xe2\x94\x82  Owner   \xe2\x94\x82  Access privileges   \xe2\x94\x82      Description       \n\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xbc\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\n myschema \xe2\x94\x82 postgres \xe2\x94\x82                      \xe2\x94\x82 \n public   \xe2\x94\x82 postgres \xe2\x94\x82 postgres=UC/postgres\xe2\x86\xb5\xe2\x94\x82 standard public schema\n          \xe2\x94\x82          \xe2\x94\x82 =UC/postgres         \xe2\x94\x82 \n(2 rows)\n
Run Code Online (Sandbox Code Playgroud)\n

python postgresql sqlalchemy

4
推荐指数
1
解决办法
597
查看次数

带有按钮和输入不呈现的弹出 HTML 内容

我正在尝试向 popover 添加按钮,但它似乎没有呈现。

是像我一样完成还是有更好的方法。

$('#myinput').popover({
    trigger   : "focus",
    container : 'body',
    placement : "bottom",
    html      : true,
    title     : "Choosy Popover",
    content   : `<input></input> Excellent <br><button type="submit">Why no display</button>`
})
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

<input id="myinput" />
Run Code Online (Sandbox Code Playgroud)

html javascript bootstrap-4

4
推荐指数
1
解决办法
458
查看次数

emacs仅在编程模式下保存时删除尾随空格

以下行在保存时删除所有训练空白区域.

(add-hook 'write-file-hooks 'delete-trailing-whitespace)
Run Code Online (Sandbox Code Playgroud)

但我想只在我处于编程模式时挂钩这个功能,所以我做到了

(defun nuke_traling ()
  (add-hook 'write-file-hooks 'delete-trailing-whitespace) 
)

(add-hook 'prog-mode-hook 'nuke_traling)
Run Code Online (Sandbox Code Playgroud)

哪些不是停止哪些不在编程模式.

emacs whitespace mode

3
推荐指数
2
解决办法
2014
查看次数

比较 javascript FormData 对象

如何比较 FormData 对象,我试图在发送 ajax 请求之前检查表单是否已更改。

但似乎无法比较对象。有什么方法可以将其转换为 js Object 或优雅的方式吗?

let a = new FormData()
let b = new FormData()

console.log(a === b ) // returns false
Run Code Online (Sandbox Code Playgroud)

javascript form-data

2
推荐指数
1
解决办法
737
查看次数