本文整理汇总了Python中searcher.Searcher.unfilter_categories方法的典型用法代码示例。如果您正苦于以下问题:Python Searcher.unfilter_categories方法的具体用法?Python Searcher.unfilter_categories怎么用?Python Searcher.unfilter_categories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类searcher.Searcher
的用法示例。
在下文中一共展示了Searcher.unfilter_categories方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: search
# 需要导入模块: from searcher import Searcher [as 别名]
# 或者: from searcher.Searcher import unfilter_categories [as 别名]
def search(request, search=None, cats=None, scats=None):
page_number = request.GET.get('page', 1)
searcher = Searcher(search, cats, scats)
snps = Post.objects.order_by('-posted')
snps = searcher.filter_queryset(snps)
searcher.unfilter_categories()
selector = QuerySelector(snps, dict(
download=DownloadNzbAction(),
))
if request.method == 'POST':
action_response = selector.apply_action(request)
if isinstance(action_response, HttpResponse):
return action_response
paginator = Paginator(
selector,
settings.POST_PER_PAGE,
allow_empty_first_page=True,
orphans=0,
)
if page_number == "last":
page = paginator.page(paginator.num_pages)
else:
try:
page = paginator.page(page_number)
except InvalidPage, EmptyPage:
raise Http404