@non_atomic_requests
def search_tools(request, category=None):
 (APP, TYPE) = (request.APP, amo.ADDON_SEARCH)
 qs = Category.objects.filter(application=APP.id, type=TYPE)
 categories = sorted(qs, key=attrgetter('weight', 'name'))
 (addons, filter) = addon_listing(request, [TYPE], SearchToolsFilter, 'popular')
 if category:
  category = get_object_or_404(qs, slug=category)
  addons = addons.filter(categories__id=category.id)
 addons = amo.utils.paginate(request, addons)
 base = Addon.objects.listed(request.APP, amo.STATUS_PUBLIC).filter(type=amo.ADDON_EXTENSION)
 sidebar_ext = SearchExtensionsFilter(request, base, 'sort', 'popular')
 return render(request, 'browse/search_tools.html', {'categories': categories, 'category': category, 'addons': addons, 'filter': filter, 'search_extensions_filter': sidebar_ext})

@ non_atomic_requests def search_tools ( request , category = None ) : ( APP , TYPE ) = ( request . APP , amo . ADDON_SEARCH ) qs = Category . objects . filter ( application = APP . id , type = TYPE ) categories = sorted ( qs , key = attrgetter ( 'weight' , 'name' ) ) ( addons , filter ) = addon_listing ( request , [ TYPE ] , SearchToolsFilter , 'popular' ) if category : category = get_object_or_404 ( qs , slug = category ) addons = addons . filter ( categories__id = category . id ) addons = amo . utils . paginate ( request , addons ) base = Addon . objects . listed ( request . APP , amo . STATUS_PUBLIC ) . filter ( type = amo . ADDON_EXTENSION ) sidebar_ext = SearchExtensionsFilter ( request , base , 'sort' , 'popular' ) return render ( request , 'browse/search_tools.html' , { 'categories' : categories , 'category' : category , 'addons' : addons , 'filter' : filter , 'search_extensions_filter' : sidebar_ext } )
view the search tools page .