'Update specific fields of a record.'

def update(self, commit=True, **kwargs):

    for (attr, value) in kwargs.items():
        setattr(self, attr, value)
    return ((commit and self.save()) or self)
