urls.py
changeset 51 07ca28f3a9f2
parent 50 f13cf27a360b
child 53 8103d18907a0
--- a/urls.py	Mon Feb 09 00:24:13 2009 +0200
+++ b/urls.py	Mon Feb 09 01:11:05 2009 +0200
@@ -10,16 +10,23 @@
 import handlers
 
 # for types
-import channels, log_formatter, utils
+import utils
+
+# for configuration
+import channels, log_formatter
 
 # our URLConfig
 urls = url = urltree.URLConfig(
-    type_dict   = { 
-        # lookup LogChannel
-        'cid':  channels.channel_list.lookup,
-        'fmt':  log_formatter.by_name,
-        'date': utils.Date(None, '%Y-%m-%d'),
-    }
+    type_dict   = dict(
+        # LogChannel
+        cid     = utils.URLChannelName(channels.channel_list.dict()),
+
+        # LogFormatter
+        fmt     =  utils.URLFormatterName(log_formatter.FORMATTERS),
+
+        # datetime
+        date    = utils.URLDateType('%Y-%m-%d'),
+    )
 )
 
 # urls
@@ -27,6 +34,7 @@
 channel_select  = url('/channel_select/?channel:cid',                                   handlers.channel_select         )
 channel_view    = url('/channels/{channel:cid}/?count:int=10&formatter:fmt=irssi',      handlers.channel_view           )
 channel_last    = url('/channels/{channel:cid}/last/{count:int=100}/{format=html}',     handlers.channel_last           )
+channel_date    = url('/channels/{channel:cid}/calendar',                               handlers.channel_calendar       )
 channel_date    = url('/channels/{channel:cid}/date/{date:date}/?formatter:fmt=irssi',  handlers.channel_date           )
 channel_search  = url('/channels/{channel:cid}/search/?q',                              handlers.channel_search         )