handlers.py
changeset 63 416560b82116
parent 62 e7ca94b94a4e
child 65 8b50694f841e
--- a/handlers.py	Mon Feb 09 07:15:19 2009 +0200
+++ b/handlers.py	Mon Feb 09 07:32:11 2009 +0200
@@ -140,6 +140,7 @@
     # lines
     lines = formatter.format_html(lines)
 
+    # render
     return templates.render_to_response("channel_date",
         req             = request,
         prefs           = request.prefs,
@@ -148,10 +149,31 @@
         lines           = lines,
     )
 
-def channel_search (request, channel, q) :
+@preferences.handler(prefs.formatter)
+def channel_search (request, channel, formatter, q=None) :
     """
         Display the search form for the channel for GET, or do the search for POST
     """
 
-    pass
+    # got a search query?
+    if q :
+        # do search
+        lines = channel.source.get_search(q)
 
+        # format
+        lines = formatter.format_html(lines)
+
+    else :
+        lines = None
+    
+    # render
+    return templates.render_to_response("channel_search",
+        req             = request,
+        prefs           = request.prefs,
+        channel         = channel,
+        query           = q,
+        lines           = lines,
+    )
+
+
+