コード例 #1
0
ファイル: base.py プロジェクト: amcdunn/CloudMining
 def GET(self, path):
     # get variables including the user preferences
     i = web.input(s=0, so='', ot='')
     start = int(i.s)
     pref = user_pref.get()
     # transform pretty url path into a query
     query = fsphinx.PrettyUrlToQuery(path, order=i.ot)
     # call model to search the items
     query, hits, facets = items.search(query, start, config.results_per_page, i.so, pref)
     # handle empty result set
     if not hits.total_found:
         facets = items.get_facets_from_cache('', pref)
     # create a pager to go through the results
     pager = paging.get_paging(start, hits['total_found'],
         results_per_page=config.results_per_page, window_size=config.paging_window_size)
     # call the proper view to display the results
     return view.layout(view.search(query, hits, facets, pager, pref))
コード例 #2
0
ファイル: base.py プロジェクト: huasanyelao/CloudMining
 def GET(self, path):
     # get variables including the user preferences
     i = web.input(s=0, so='', debug=False, ot='')
     start = int(i.s)
     pref = user_pref.get()
     # transform pretty url path into a query
     query = fsphinx.PrettyUrlToQuery(path, order=i.ot)
     # call model to search the items
     query, hits, facets = items.search(query, start, config.results_per_page, i.so, pref)
     # handle empty result set
     if not hits.total_found:
         facets = items.get_facets_from_cache('', pref)
     # create a pager to go through the results
     pager = paging.get_paging(start, hits['total_found'],
         results_per_page=config.results_per_page, window_size=config.paging_window_size)
     # call the proper view to display the results
     return view.layout(view.search(query, hits, facets, pager, pref))
コード例 #3
0
ファイル: base.py プロジェクト: amcdunn/CloudMining
    def GET(self):
        pref = user_pref.reset()
	facets = items.get_facets_from_cache('', pref)
        return view.layout(view.front_page(facets, pref))
コード例 #4
0
ファイル: base.py プロジェクト: huasanyelao/CloudMining
 def GET(self):
     pref = user_pref.reset()
     facets = items.get_facets_from_cache('', pref)
     return view.layout(view.front_page(facets, pref))