django orm的聚合、字符串和条件sql函数。
django-aggregates的Python项目详细描述
django aggregates要用于注释和聚合方法的aggregate、string和条件sql函数。欢迎任何类型的发明和想法。
installation
===========
用法
=============
>;
>用法
========
>>;people.objects.aggregatgatgatgate(names=stringagg('name',分隔符(',')
>;{'names':'沃尔特,花花花花花公子,'walter,是的donny,jesus'}
>;从聚合导入为
>;people.objects.values('address\u title').annotate(prettyname=as('address\u title').values('prettyname')
>;[{prettyname':'someaddress1'},{prettyname':'someaddress2'}
>;;从聚合导入charlength
>;people.objects.annotate(char_leng=charleng('name')).filter(char戋leng戋gt=6)
>;[<;people:walter>;,<;people:the dude>;]
>;>;从聚合中导入coalesce,null if
>;person=people.objects.annotate(null戋if=nullif('name',othercol='lash')[0]
>;如果
>>gt;'walter'
>>gt;person.person.null;则为person.null;如果
>;person.null;则为person.objects.annotate(coalesce=coalesce=coalesce('age,默认值为18),则为[0]
>;person.coalesce
>;18
>;person.person.age
>;
>可用函数
=============================>br/>>聚合:
>-作为
-比特与
-bitor
-booland-booland**只有postgresqsql**
-boolor**只有postgresqsql**
-每一个**只有postgresqsql**
-stringagg**只有postgresqsql**
-xmlagg**;只有postgresqsql**
-corr**只有postgresqsql**
-postgresqsql**
-covarprop;只有postgresqsql**
-covarprop;只有postgresqsql**
-covarsparprop;只有postgres仅限PostgreSQL**
-仅限RegravGx**PostgreSQL**
-regregregavgy**訛仅PostgreSQL**
-regcount**訛仅PostgreSQL**
-regintercept**仅PostgreSQL**
-regrr2**訛仅PostgreSQL**
-reggrslope**訛仅PostgreSQL**
-regsrxx**仅PostgreSQL******仅PostgreSQL****
-regregregregsrgy****仅PostgreSQL******仅PostgreSQL****仅限PostgreSQL**
-仅限模式**PostgreSQL 9.4+**
-percentilecont**,仅PostgreSQL 9.4+**
-percentiledisc**,仅PostgreSQL 9.4+**
字符串:
>从aggregregregregregregreSQL 9.4+**
-字符长度
-octeletlength
-下
-上
-ascii
-字符长度
-octelength
-ocetlength
-下
-上
-ascii
-长度
-长度
-长度
-md5**只有PostgreSQL**
>从AggregregregreSQL中导入条件…
-nullif
-coalesce**;只有PostgreSQL**
-nullif
-coalesce**-coalesce**;只有PostgreSQL**
-br/>-django 1.2+
todo
==========>-单元测试。
-有关函数的更多详细信息。
-json函数和操作
installation
===========
用法
=============
>;
>用法
========
>>;people.objects.aggregatgatgatgate(names=stringagg('name',分隔符(',')
>;{'names':'沃尔特,花花花花花公子,'walter,是的donny,jesus'}
>;从聚合导入为
>;people.objects.values('address\u title').annotate(prettyname=as('address\u title').values('prettyname')
>;[{prettyname':'someaddress1'},{prettyname':'someaddress2'}
>;;从聚合导入charlength
>;people.objects.annotate(char_leng=charleng('name')).filter(char戋leng戋gt=6)
>;[<;people:walter>;,<;people:the dude>;]
>;>;从聚合中导入coalesce,null if
>;person=people.objects.annotate(null戋if=nullif('name',othercol='lash')[0]
>;如果
>>gt;'walter'
>>gt;person.person.null;则为person.null;如果
>;person.null;则为person.objects.annotate(coalesce=coalesce=coalesce('age,默认值为18),则为[0]
>;person.coalesce
>;18
>;person.person.age
>;
>可用函数
=============================>br/>>聚合:
>-作为
-比特与
-bitor
-booland-booland**只有postgresqsql**
-boolor**只有postgresqsql**
-每一个**只有postgresqsql**
-stringagg**只有postgresqsql**
-xmlagg**;只有postgresqsql**
-corr**只有postgresqsql**
-postgresqsql**
-covarprop;只有postgresqsql**
-covarprop;只有postgresqsql**
-covarsparprop;只有postgres仅限PostgreSQL**
-仅限RegravGx**PostgreSQL**
-regregregavgy**訛仅PostgreSQL**
-regcount**訛仅PostgreSQL**
-regintercept**仅PostgreSQL**
-regrr2**訛仅PostgreSQL**
-reggrslope**訛仅PostgreSQL**
-regsrxx**仅PostgreSQL******仅PostgreSQL****
-regregregregsrgy****仅PostgreSQL******仅PostgreSQL****仅限PostgreSQL**
-仅限模式**PostgreSQL 9.4+**
-percentilecont**,仅PostgreSQL 9.4+**
-percentiledisc**,仅PostgreSQL 9.4+**
字符串:
>从aggregregregregregregreSQL 9.4+**
-字符长度
-octeletlength
-下
-上
-ascii
-字符长度
-octelength
-ocetlength
-下
-上
-ascii
-长度
-长度
-长度
-md5**只有PostgreSQL**
>从AggregregregreSQL中导入条件…
-nullif
-coalesce**;只有PostgreSQL**
-nullif
-coalesce**-coalesce**;只有PostgreSQL**
-br/>-django 1.2+
todo
==========>-单元测试。
-有关函数的更多详细信息。
-json函数和操作