'Update metadata descriptor from key_values. Saves to modulestore if save is true.'

@classmethod
def update_from_dict(cls, key_values, descriptor, user, save=True):

    for (key, value) in key_values.iteritems():
        setattr(descriptor, key, value)
    if (save and len(key_values)):
        modulestore().update_item(descriptor, user.id)
    return cls.fetch(descriptor)
