def select_character_by_specific_column(column_name, key): matched_character = DBAccessor.execute('select * from Character where {0}={1} limit 1'.format( column_name, convert_datum_to_command(key))).fetchone() if matched_character is None: raise ValueError('Character with {0} {1} does not existed.'.format(column_name, key)) return Character(matched_character)
def select_character_list(): return [Character(each) for each in DBAccessor.execute('select {0} from Character'.format(','.join(Character.DB_TABLE)))]