예제 #1
0
    def update_serial(self, serial: Serial):
        if not serial:
            return None

        serial.save()
        # self._settings.refresh_from_db(['series'])
        self._notify_serial_updated(serial)
예제 #2
0
 def update_entry(self, serial: Serial):
     serial.name = self.name.data
     serial.group = self.group.data
     serial.description = self.description.data
     serial.season = self.season.data
     serial.visible = self.visible.data
     return serial
예제 #3
0
 def make_serial(self) -> Serial:
     return Serial()
예제 #4
0
 def _notify_serial_removed(self, serial: Serial):
     self.__notify_front(Service.SERIAL_REMOVED, serial.to_front_dict())
예제 #5
0
 def _notify_serial_updated(self, serial: Serial):
     self.__notify_front(Service.SERIAL_UPDATED, serial.to_front_dict())
예제 #6
0
 def _notify_serial_added(self, serial: Serial):
     self.__notify_front(Service.SERIAL_ADDED, serial.to_front_dict())
예제 #7
0
 def remove_serial(self, sid: ObjectId):
     serial = Serial.get_by_id(sid)
     if serial:
         self._settings.remove_serial(serial)
         self._settings.save()
         self._notify_serial_removed(serial)
예제 #8
0
 def make_entry(self):
     return self.update_entry(Serial())