1
0
mirror of https://github.com/beego/bee.git synced 2024-11-29 22:01:28 +00:00

isnull filter needs boolean value for the Filter function

This commit is contained in:
Ronnie A. Baez Sesto 2016-11-16 15:31:10 -04:00 committed by GitHub
parent f7d2e04e07
commit 87e2237f5b

View File

@ -1062,7 +1062,15 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
for k, v := range query { for k, v := range query {
// rewrite dot-notation to Object__Attribute // rewrite dot-notation to Object__Attribute
k = strings.Replace(k, ".", "__", -1) k = strings.Replace(k, ".", "__", -1)
qs = qs.Filter(k, v) if strings.Contains(k, "isnull") {
var v2 bool
if v == "true" || v == "1" {
v2 = true
}
qs = qs.Filter(k, v2)
} else {
qs = qs.Filter(k, v)
}
} }
// order by: // order by:
var sortFields []string var sortFields []string