code: def update(self, commit=True, **kwargs):
          
  
          for (attr, value) in kwargs.iteritems():
              setattr(self, attr, value)
          return commit and self.save() or self
docs: Update model attributes and save to database