Hi,
I can not get the model find_all to work correctly when I want to use MySQL
operators of '!=' and 'NOT REGEXP'. I think it has to do with the pattern in
the string.gsub() in "build_query".
To fix the '!=' just add '!' to the string.gsub() pattern.
- string.gsub(condition, "([%w_]+)%s*([%a<>=]+)%s*%?",
+ string.gsub(condition, "([%w_]+)%s*([%a<>!=]+)%s*%?",
Here is the code I use to call model:find_all()
> self:find_all("notes NOT REGEXP ?", { Autobahn })
Here is the error:
> /usr/local/rocks//orbit/2.0.2-1/lua/orbit/model.lua:310: attempt to index
> field '?' (a nil value)
> stack traceback:
> /usr/local/rocks//orbit/2.0.2-1/lua/orbit/model.lua:310: in function
> [C]: in function 'gsub'
> /usr/local/rocks//orbit/2.0.2-1/lua/orbit/model.lua:296: in function
> 'build_query'
> /usr/local/rocks//orbit/2.0.2-1/lua/orbit/model.lua:342: in function
> (tail call): ?
> ./search_view.lua:440: in function '_SearchResults'
> ./search_view.lua:472: in function <./search_view.lua:469>
> (tail call): ?
> (tail call): ?/usr/local/rocks//orbit/2.0.2-1/lua/orbit/model.lua:310:
> attempt to index field '?' (a nil value)
> stack traceback:
> /usr/local/rocks//coxpcall/1.13.0-1/lua/coxpcall.lua:24: in function
> (tail call): ?
> (tail call): ?
> /usr/local/rocks//orbit/2.0.2-1/lua/orbit.lua:497: in function
> (tail call): ?
> (tail call): ?
>
> Any help would be greatly appreciated.
--
Regards,
Ryan
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/