]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Add categories to servers.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 29 Apr 2017 16:15:36 +0000 (12:15 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 29 Apr 2017 16:15:36 +0000 (12:15 -0400)
xonstat/models/server.py

index 387c2cddad37206f2041986593957fd82f64a8ee..5d6d7fdcf6443817828b9a6d2ee03f2cf22076ea 100644 (file)
@@ -12,12 +12,13 @@ class Server(FuzzyDateMixin, EpochMixin):
     A Xonotic server, identifiable by name and (when there's a conflict) hashkey.
     """
 
-    def __init__(self, name=None, hashkey=None, ip_addr=None, elo_ind=None):
+    def __init__(self, name=None, hashkey=None, ip_addr=None, elo_ind=None, categories=None):
         self.name = name
         self.hashkey = hashkey
         self.ip_addr = ip_addr
         self.elo_ind = elo_ind if elo_ind is not None else True
         self.create_dt = dt.utcnow()
+        self.categories = categories
 
     def __repr__(self):
         return "<Server({}, {})>".format(self.server_id, self.name.encode('utf-8'))
@@ -28,4 +29,5 @@ class Server(FuzzyDateMixin, EpochMixin):
             'name': self.name,
             'ip_addr': self.ip_addr,
             'location': self.location,
+            'categories': self.categories,
         }