'Write changes to db.'

def write_changes_to_db(self, changes, brand_new_thing=False):

    if (not changes):
        return
    data_props = {}
    props = {}
    for (prop, (old_value, new_value)) in changes.iteritems():
        if prop.startswith('_'):
            props[prop[1:]] = new_value
        else:
            data_props[prop] = new_value
    self.write_props_to_db(props, data_props, brand_new_thing)
