Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saved search added and tested #5

Open
wants to merge 10 commits into
base: master
from

fixed it so the search would work with ones that specified inputs

  • Loading branch information
mnuyens committed Jun 5, 2012
commit 70d2068d8a6824d099b22c60b7770319130236f5
@@ -127,15 +127,9 @@ def savedsearch(self,q="",**_kwargs):
if x!="terms" and x!="inputs" and x!="devices":
opts[self.ssdict[x]]=params[x]
if params['inputs']:
inputs+=" AND (inputname:"+params['inputs'][0]
for x in params['inputs'].__iter__().next():
inputs+=" OR inputname:"+x
inputs+=")"
inputs+=" AND (inputname:"+" OR inputname:".join(params['inputs'])+")"
if params['devices']:
devices+=" AND (ip:"+params['devices'][0]
for x in params['devices'].__iter__().next():
devices+=" OR ip:"+x
devices+=")"
devices+=" AND (ip:"+" OR ip:".join(params['devices'])+")"
return self.search(q=params['terms']+inputs+devices,**opts)


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.