一个sqlalchemy插件,允许postgres使用citext。

sqlalchemy-citext的Python项目详细描述


#sqlalchemy citext

创建一个sqlalchemy用户定义类型以理解
[postgresql的citext](http://www.postgresql.org/docs/9.1/static/citext.html)
扩展。


已经安装了类似“psycopg2”的程序。

``` bash
pip install sqlalchemy citext
````


import sqlalchemy.orm as orm

engine=create_engine('postgresql://localhost/test_db')
meta=metadata()


test_table=table('test',meta,
column('id',integer(),primary_key=true),
column('txt',


conn=engine.connect()



meta.bind=conn
meta.drop_all()
>meta.create_all()



>类testobj(object):
>def _init(self,id,txt):
>self.id=id
>self.txt=txt


>def _repr _repr uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu%r)“(self.id,self.txt)

orm.mapper(testobj,test_table)
session=orm.sessionmaker(bind=engine)
ses=session()

to=testobj(1,
ses.add(to)
ses.commit()
row=ses.query(testobj.filter(testobj.txt==‘fooffighter’).all()
assert len(row)==1
print row
ses.close()
````




`sqlalchemy citext`是一个mit/bsd双许可的图书馆。






贡献

-检查未解决的问题或打开新的开始讨论一个
功能想法或一个bug。
-在github上派生存储库,开始对master
分支(或分支)进行更改。
-编写一个测试,显示bug已修复或功能
按预期工作。
-发送一个pull请求并对维护程序进行bug,直到它被合并为止以及
已发布。
-确保将自己添加到“setup.py”中作者的文件中,以及下面的“贡献者”部分:)





>-[@mahmoudimus(https://github.com/mahmoudimus)
-[@vad(https://github.com/vad)
-[@dstufft(https://github.com/dstufft)
-[@brmzkw(https://github.com/https://github.com/dstufft)(https://github.com/dstufft)和
-[@brmz布尔姆兹克)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java不调用未来。有什么问题吗?   isSelected(),isDisplayed在selenium、java for checkbox中不适用于我。其中xpath不显示是选中还是未选中   java在线应用程序创建者是如何工作的?是否有任何示例源代码可供查看?   Rest服务中的java Spring启动自定义异常   java将成员对象添加到ArrayList<Membership>   关键字这个Java项目如何使用语言保留字作为标识符?   字符串格式如何在Java中打印列中的双精度数组   java libgdx动画仅在事件上出现一次   java如何使用spring。应用docker容器上RestTemplate url中的名称?   java Hibernate UnuniqueObjectException:具有相同标识符值的不同对象已与会话关联   使用leapmotion、光标显示的java处理   java Libgdx Box2D仅针对少数特定对象控制冲突响应   带外键的java Spring数据JPA@Query:参数不匹配   java在我的“ifelse”语句中遇到问题,我不知道如何将文本字段转换为整数(或其他)   java Maven插件没有在我希望的地方运行