better get_table_columns

This commit is contained in:
j 2016-01-17 14:00:39 +05:30
parent b00647e3f3
commit 0faea277d1

View file

@ -95,7 +95,8 @@ def get_create_table(table):
def get_table_columns(table):
create_table = get_create_table(table)
columns = [r.strip().split()[0] for r in re.compile('(.*?),').findall(create_table)][:-1]
columns = create_table.split('(', 1)[1].rsplit(')', 1)[0]
columns = [r.strip().split()[0] for r in re.compile('(.*?),').findall(columns)]
columns = [col for col in columns if col.islower()]
return columns