╰─ cat slavicdb/models/violation.py from peewee import FixedCharField, CharField from playhouse.apsw_ext import DateTimeField from slavicdb.models.common import Model class Violation(Model): # pylint: disable=too-few-public-methods src = FixedCharField(18) dst = FixedCharField(18) service = CharField(255) kpi = CharField(255) start = DateTimeField() end = DateTimeField(null=True) def __eq__(self, other): if self.src == other.src and self.dst == other.dst and self.service == other.service and self.kpi == other.kpi: return True return False def __ne__(self, other): return not self.__eq__(other) def type(self): return "/".join([self.service, self.kpi])