--- a/pvl/verkko/hosts.py Sat Jan 26 22:18:55 2013 +0200
+++ b/pvl/verkko/hosts.py Sun Jan 27 14:48:40 2013 +0200
@@ -29,16 +29,6 @@
MAC_RE = re.compile(MAC_SEP.join([MAC_HEX] * 6))
@classmethod
- def query (cls, session, seen=None) :
- """
- seen - select hosts seen during given timedelta period
- """
-
- query = session.query(cls)
-
- return query
-
- @classmethod
def normalize_mac (cls, mac) :
match = cls.MAC_RE.search(mac)
@@ -144,7 +134,7 @@
## Controller
class HostsTable (table.Table) :
"""
- Table of hosts.
+ <table> of hosts.
"""
ITEMS = "Hosts"
@@ -180,7 +170,7 @@
"/static/dhcp/hosts.css",
)
- # model
+ # view
TABLE = HostsTable
def query (self) :
--- a/pvl/verkko/leases.py Sat Jan 26 22:18:55 2013 +0200
+++ b/pvl/verkko/leases.py Sun Jan 27 14:48:40 2013 +0200
@@ -32,7 +32,7 @@
return None
def ends_class (self) :
- if self.ends > datetime.datetime.now() :
+ if self.ends and self.ends > datetime.datetime.now() :
return 'active'
else :
return None
@@ -53,7 +53,7 @@
class LeasesTable (table.Table) :
"""
- Table of leases.
+ <table> of leases.
"""
ITEMS = "Leases"
@@ -88,7 +88,7 @@
"/static/dhcp/hosts.css",
)
- # model
+ # view
TABLE = LeasesTable
def query (self) :