一个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布尔姆兹克)
创建一个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布尔姆兹克)