SQLAlchemy way to explore https:https://cdn.v2ex.com/navatar/298f/95e1/532_normal.png?m=1476412806 https:https://cdn.v2ex.com/navatar/298f/95e1/532_large.png?m=1476412806 2021-01-06T04:03:33Z Copyright © 2010-2018, V2EX sqlalchemy 批量更新(非主键)有什么其他好方法吗? tag:www.v2ex.com,2021-01-06:/t/742140 2021-01-06T04:03:33Z 2021-01-06T04:03:33Z Raul7 member/Raul7 有一个 dict 的列表,想批量 update 数据库。表里的主键是 id,但是判断唯一是用的另外一个字段。

循环 list 一条条更新效率不高,请教下是否有其他好方法?

]]>
Python ORM 为什么可以不区分变量类型? tag:www.v2ex.com,2018-07-12:/t/470336 2018-07-12T12:07:50Z 2018-07-12T13:43:49Z miniyao member/miniyao book 的 id 存在数据库里是 int,但查询的时候,给一个 int 和 string 都可以查:

book = Book.query.filter(Book.id == book_id).first() book = Book.query.filter(Book.id == str(book_id)).first() 
]]>
是不是只要用 sqlalchemy 就能基本防止 sql 注入? 用 sqlalchemy 来执行 sql 是不是也能防止? tag:www.v2ex.com,2016-01-22:/t/252547 2016-01-22T02:27:32Z 2016-01-22T05:23:53Z clino member/clino SQLAlchemy 如何查询 参数 in 字段? tag:www.v2ex.com,2015-02-13:/t/170672 2015-02-13T02:57:43Z 2015-02-13T03:40:22Z john990 member/john990 TAG_ID(varchar)
-------------
10,13,15,20
3,10,15,20
3,15

现给定一个tag=10,查询包含这个tag的数据

用sql应该这样写:
SELECT * FROM table WHERE FIND_IN_SET('10',TAG_ID)

用SQLAlchemy应该怎么操作(Model name = Post)

mysql数据库 ]]>
使用 sqlalchemy-datatables 呈现 table tag:www.v2ex.com,2014-01-27:/t/98508 2014-01-27T09:44:00Z 2014-05-28T01:22:05Z yoyicue member/yoyicue 而 DataTables 是好多年来呈现 table 不多的选择之一
能解决大部分对于 table 的需求.

但是 API 有些繁琐, 这次恰好看到了有 Python 相关的封装, 推荐给大家

Pyramid 框架
https://github.com/Pegase745/sqlalchemy-datatables

稍微改了下, 做成了 Flask 框架的:
https://github.com/Pegase745/sqlalchemy-datatables

Django 的选择貌似多了些:
https://github.com/noirbizarre/django-eztables
https://github.com/pivotal-energy-solutions/django-datatable-view
https://bitbucket.org/pigletto/django-datatables-view ]]> 如果后期需要修改ORM结构,怎么备份和处理之前已经存进去的数据呢? tag:www.v2ex.com,2013-07-14:/t/75711 2013-07-14T03:42:41Z 2013-07-14T03:42:41Z ivanlw member/ivanlw 有人在正式项目里使用过sqlalchemy么? tag:www.v2ex.com,2012-04-23:/t/33027 2012-04-23T04:38:04Z 2012-07-12T17:17:40Z stingh711 member/stingh711 ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86