def update(self, commit=True, **kwargs):
        """ Update model attributes and save to database """

        for (attr, value) in kwargs.iteritems():
            setattr(self, attr, value)
        return commit and self.save() or self
Update model attributes and save to database