From: Eevee Date: Mon, 5 Oct 2009 02:17:44 +0000 (-0700) Subject: Make search a GET to /search. X-Git-Url: http://git.veekun.com/zzz-floof.git/commitdiff_plain/c50e600e708d2083290134440223ab65076376ee?ds=sidebyside Make search a GET to /search. --- diff --git a/floof/config/routing.py b/floof/config/routing.py index f78246a..03edbeb 100644 --- a/floof/config/routing.py +++ b/floof/config/routing.py @@ -26,6 +26,8 @@ def make_map(): map.connect('/account/login_begin', controller='account', action='login_begin', **require_POST) map.connect('/account/login_finish', controller='account', action='login_finish') + map.connect('/search', controller='search', action='index') + map.connect('/{controller}/{action}') map.connect('/{controller}/{action}/{id}') diff --git a/floof/controllers/search.py b/floof/controllers/search.py index 75bbba8..88dfbe3 100644 --- a/floof/controllers/search.py +++ b/floof/controllers/search.py @@ -13,14 +13,8 @@ import elixir class SearchController(BaseController): def index(self): - # Return a rendered template - #return render('/search.mako') - # or, return a response - return 'Hello World' - - def results(self): - """ Search, implemented the stupid way! """ - query = request.params.get('query','') + """Search, implemented the stupid way!""" + query = request.params.get('query', '') tags = query.split() tagtexts = TagText.query.filter(TagText.text.in_(tags)) diff --git a/floof/templates/base.mako b/floof/templates/base.mako index 19f8455..e36f3ea 100644 --- a/floof/templates/base.mako +++ b/floof/templates/base.mako @@ -10,8 +10,8 @@