def set_person_data(person_id, tag, value, user_level=None): ''' @param person_id: @type person_id: int @param tag: @type tag: string @param value: @type value: string @param user_level: @type user_level: int ''' old = dbinter.get_personid_row(person_id, tag) old_data = [tup[0] for tup in old] if value not in old_data: dbinter.set_personid_row(person_id, tag, value, opt2=user_level)
def get_person_data(person_id, tag): res = dbinter.get_personid_row(person_id, tag) if res: return (res[1], res[0]) else: return []
def set_person_data(person_id, tag, value, user_level=0): old = dbinter.get_personid_row(person_id, tag) if old[0] != value: dbinter.set_personid_row(person_id, tag, value, opt2=user_level)