author | Tero Marttila <terom@paivola.fi> |
Fri, 12 Oct 2012 16:34:53 +0300 | |
changeset 13 | a2f245750700 |
parent 8 | f64c44640b15 |
child 19 | 4e2e26f4d058 |
permissions | -rw-r--r-- |
from werkzeug.routing import Map, Rule def rule (string, endpoint, **opts) : return Rule(string, endpoint=endpoint, **opts) # URL -> Handler from pvl.verkko import hosts # index page here :) from pvl.verkko import web class Index (web.Handler) : def render (self) : html = web.html return ( html.ul( # TODO: self.url html.a(href=self.url(hosts.ListHandler))("DHCP Hosts"), ) ) urls = Map(( rule('/', Index), rule('/hosts/', hosts.ListHandler), rule('/hosts/<int:id>', hosts.ItemHandler), ))