# SPDX-License-Identifier: WTFPL from .dbrecord import DbRecord from yms.lookup import Table class Fuse(DbRecord): table = "fuse" pk_field = "fuseid" pk_is_auto = True fields = ('fuseid', 'vid', 'fnumber', 'ftype', 'current', 'cableid', 'eid', 'location', 'description', 'color', 'remarks') def __init__(self, db, fuseid=None): super().__init__(db, fuseid) self.title = _("Fuse({})") def save(self, commit=True): if not super().save(Table.FUSES): return False if commit: try: self.conn.commit() except mariadb.Error as e: return False return True