isnull filter needs boolean value for the Filter function

With changes suggested by @amrfaissal
This commit is contained in:
Ronnie A. Baez Sesto 2016-11-16 16:39:54 -04:00 committed by GitHub
parent 9aaade6cbb
commit fb93677604
1 changed files with 5 additions and 1 deletions

View File

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