def update(self, **kwargs) -> 'Blackout': if kwargs.get('startTime'): kwargs['startTime'] = DateTime.parse(kwargs['startTime']) if kwargs.get('endTime'): kwargs['endTime'] = DateTime.parse(kwargs['endTime']) blackout = Blackout.from_db(db.update_blackout(self.id, **kwargs)) process_blackout(blackout, action='update') return blackout
def update(self, **kwargs) -> 'Blackout': kwargs['startTime'] = DateTime.parse( kwargs['startTime']) if 'startTime' in kwargs else None kwargs['endTime'] = DateTime.parse( kwargs['endTime']) if 'endTime' in kwargs else None return Blackout.from_db(db.update_blackout(self.id, **kwargs))
def update(self, **kwargs) -> 'Blackout': if kwargs.get('startTime'): kwargs['startTime'] = DateTime.parse(kwargs['startTime']) if kwargs.get('endTime'): kwargs['endTime'] = DateTime.parse(kwargs['endTime']) return Blackout.from_db(db.update_blackout(self.id, **kwargs))