code: def update_all(cls, *criterion, **kwargs):
          
          try:
              r = cls.query.filter(*criterion).update(kwargs, 'fetch')
              cls.session.commit()
              return r
          except:
              cls.session.rollback()
              raise
docs: Batch method for updating all instances obeying the criterion
  
          Args:
              *criterion: SQLAlchemy query criterion for filtering what
                  instances to update
              **kwargs: The parameters to be updated
  
          Examples:
  
              >>> User.update_all(active=True)
  
              >>> Customer.update_all(Customer.country=='India', active=True)
  
          The second example sets active=True for all customers with
          country India.