def view_search(request): from api.search import SearchEngine search = request.GET.get("q", "").strip() terms = [x.strip() for x in search.split(" ") if x] se = SearchEngine() query = se.search_series(user=request.user, *terms) return render_series_list_page(request, query, search=search, project=se.project(), keywords=se.last_keywords())
def _update_watch_queue(self, series): se = SearchEngine() for wq in WatchedQuery.objects.all(): if se.query_test_message(wq.query, series): self._add_to_queue(wq.user, series, "watched")
def handle(self, request, terms): se = SearchEngine() q = se.search_series(user=request.user, *terms) for s in q: _instance.clear_and_start_testing(s)