set_order_by

set_order_by(self, lst=None, *fields)

使用范围: server

编程语言: python

父类: Item 类

描述说明

使用 set_order_by 方法定义并存储内部存储 order_by 参数 , 未指定 order_by 参数的 open 方法将使用这些内部参数。 open 方法会清除内部存储的该参数值。

参数

你可以像客户端的 set_order_by 方法那样,以列表形式指定字段,或者以非关键字参数的形式指定字段。

如果在一个字段名前有 “-” ,那么对记录在该字段上按降序排序。

示例

下列代码片段的执行结果相同:

item.open(order_by=['customer', '-invoicedate'])
item.set_order_by('customer', '-invoicedate')
item.open();
item.set_order_by(['customer', '-invoicedate'])
item.open();

另请参见

数据集

open