From c559bcd9331deca9af276e5fa50ebe1c933a01b2 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Fri, 31 Aug 2018 10:01:37 +0000 Subject: [PATCH 1/2] resourcebase: updated_at: set list:"user" --- pkg/cloudcommon/db/resourcebase.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cloudcommon/db/resourcebase.go b/pkg/cloudcommon/db/resourcebase.go index 4c8bbcb480..a4289f2df6 100644 --- a/pkg/cloudcommon/db/resourcebase.go +++ b/pkg/cloudcommon/db/resourcebase.go @@ -13,7 +13,7 @@ type SResourceBase struct { SModelBase CreatedAt time.Time `nullable:"false" created_at:"true" get:"user"` - UpdatedAt time.Time `nullable:"false" updated_at:"true"` + UpdatedAt time.Time `nullable:"false" updated_at:"true" list:"user"` UpdateVersion int `default:"0" nullable:"false" auto_version:"true"` DeletedAt time.Time `` Deleted bool `nullable:"false" default:"false"` From 0094a5cffc925796cc7ef1095f0c12592054c30e Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Fri, 31 Aug 2018 10:00:48 +0000 Subject: [PATCH 2/2] mcclient: options: BaseListOptions: make OrderBy a list option --- pkg/mcclient/options/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mcclient/options/base.go b/pkg/mcclient/options/base.go index 35cee54cef..aeacdce442 100644 --- a/pkg/mcclient/options/base.go +++ b/pkg/mcclient/options/base.go @@ -144,7 +144,7 @@ func ListStructToParams(v interface{}) (*jsonutils.JSONDict, error) { type BaseListOptions struct { Limit *int `default:"20" help:"Page limit"` Offset *int `default:"0" help:"Page offset"` - OrderBy string `help:"Name of the field to be ordered by"` + OrderBy []string `help:"Name of the field to be ordered by"` Order string `help:"List order" choices:"desc|asc"` Details *bool `help:"Show more details"` Search string `help:"Filter results by a simple keyword search"`