From 0d77a3f8d2d4b7f27169d2652ca3da9b9c9e94db Mon Sep 17 00:00:00 2001 From: DennisMao Date: Thu, 6 Dec 2018 10:49:50 +0800 Subject: [PATCH 1/2] FixOrmDescrptionTag --- orm/models_info_f.go | 2 +- orm/models_utils.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/orm/models_info_f.go b/orm/models_info_f.go index 479f5ae6..7044b0bd 100644 --- a/orm/models_info_f.go +++ b/orm/models_info_f.go @@ -301,7 +301,7 @@ checkType: fi.sf = sf fi.fullName = mi.fullName + mName + "." + sf.Name - fi.description = sf.Tag.Get("description") + fi.description = tags["description"] fi.null = attrs["null"] fi.index = attrs["index"] fi.auto = attrs["auto"] diff --git a/orm/models_utils.go b/orm/models_utils.go index 31f8fb5a..8faa7683 100644 --- a/orm/models_utils.go +++ b/orm/models_utils.go @@ -44,6 +44,7 @@ var supportTag = map[string]int{ "decimals": 2, "on_delete": 2, "type": 2, + "description": 2, } // get reflect.Type name with package path. From bf468c8d0c75364947225be7f100f6611dec327d Mon Sep 17 00:00:00 2001 From: DennisMao Date: Thu, 6 Dec 2018 10:57:32 +0800 Subject: [PATCH 2/2] fix format --- orm/models_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orm/models_utils.go b/orm/models_utils.go index 8faa7683..13a22aca 100644 --- a/orm/models_utils.go +++ b/orm/models_utils.go @@ -44,7 +44,7 @@ var supportTag = map[string]int{ "decimals": 2, "on_delete": 2, "type": 2, - "description": 2, + "description": 2, } // get reflect.Type name with package path.