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}')
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))
<div id="header">
<a href="${h.url_for("/")}">Home</a>
-${h.form (h.url_for(controller="search", action="results"))}
-${h.text('query')} ${h.submit('search','Search')}
+${h.form(h.url_for(controller='search'), method='GET')}
+${h.text('query')} ${h.submit(None, 'Search')}
${h.end_form()}
<div id="user">