urls.py
changeset 73 5a7188bf2894
parent 72 5ade0288f2ec
child 75 c5ce145fdd70
equal deleted inserted replaced
72:5ade0288f2ec 73:5a7188bf2894
    11 
    11 
    12 # for types
    12 # for types
    13 import utils
    13 import utils
    14 
    14 
    15 # for configuration
    15 # for configuration
    16 import channels
    16 import config
    17 
    17 
    18 # our URLTypes
    18 # our URLTypes
    19 types   = dict(
    19 types   = dict(
    20     # LogChannel
    20     # LogChannel
    21     cid     = utils.URLChannelName(channels.channel_list.dict()),
    21     cid     = utils.URLChannelName(config.LOG_CHANNELS.dict()),
    22 
    22 
    23     # datetime
    23     # datetime
    24     date    = utils.URLDateType('%Y-%m-%d'),
    24     date    = utils.URLDateType(config.URL_DATE_FMT),
    25 
    25 
    26     # UTC timestamp
    26     # UTC timestamp
    27     ts      = utils.URLTimestampType(),
    27     ts      = utils.URLTimestampType(),
    28 )
    28 )
    29 
    29 
    37 channel             = url('/channels/{channel:cid}',                                        handlers.channel_last,      count=20        )
    37 channel             = url('/channels/{channel:cid}',                                        handlers.channel_last,      count=20        )
    38 channel_last        = url('/channels/{channel:cid}/last/{count:int=100}',                   handlers.channel_last                       )
    38 channel_last        = url('/channels/{channel:cid}/last/{count:int=100}',                   handlers.channel_last                       )
    39 channel_link        = url('/channels/{channel:cid}/link/{timestamp:ts}',                    handlers.channel_link                       )
    39 channel_link        = url('/channels/{channel:cid}/link/{timestamp:ts}',                    handlers.channel_link                       )
    40 channel_calendar    = url('/channels/{channel:cid}/calendar/{year:int=0}/{month:int=0}',    handlers.channel_calendar                   )
    40 channel_calendar    = url('/channels/{channel:cid}/calendar/{year:int=0}/{month:int=0}',    handlers.channel_calendar                   )
    41 channel_date        = url('/channels/{channel:cid}/date/{date:date}',                       handlers.channel_date                       )
    41 channel_date        = url('/channels/{channel:cid}/date/{date:date}',                       handlers.channel_date                       )
    42 channel_search      = url('/channels/{channel:cid}/search/?q=&count:int=&skip:int=',        handlers.channel_search                     )
    42 channel_search      = url('/channels/{channel:cid}/search/?q=&skip:int=0&max:int=',         handlers.channel_search                     )
    43 
    43 
    44 # mapper
    44 # mapper
    45 mapper = urltree.URLTree(urls)
    45 mapper = urltree.URLTree(urls)
    46 
    46