2 Models related to servers.
5 from datetime import datetime as dt
7 from xonstat.models.mixins import FuzzyDateMixin, EpochMixin
10 class Server(FuzzyDateMixin, EpochMixin):
12 A Xonotic server, identifiable by name and (when there's a conflict) hashkey.
15 def __init__(self, name=None, hashkey=None, ip_addr=None):
17 self.hashkey = hashkey
18 self.ip_addr = ip_addr
19 self.create_dt = dt.utcnow()
22 return "<Server({}, {})>".format(self.server_id, self.name.encode('utf-8'))
26 'server_id': self.server_id,
28 'ip_addr': self.ip_addr,
29 'location': self.location,