improved scripts/extract_mysql_models.py, thanks Andre Kablu
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.07.19.12.42.17
|
Version 2.6.0-development+timestamp.2013.07.19.17.41.29
|
||||||
|
|||||||
@@ -79,8 +79,9 @@ def mysql(database_name, username, password):
|
|||||||
if 'CREATE' in sql_create_stmnt: # check if the table exists
|
if 'CREATE' in sql_create_stmnt: # check if the table exists
|
||||||
#remove garbage lines from sql statement
|
#remove garbage lines from sql statement
|
||||||
sql_lines = sql_create_stmnt.split('\n')
|
sql_lines = sql_create_stmnt.split('\n')
|
||||||
sql_lines = [x for x in sql_lines if not(
|
sql_lines = filter(
|
||||||
x.startswith('--') or x.startswith('/*') or x == '')]
|
lambda x: not(x in ('','\r') or x[:2] in ('--','/*')),
|
||||||
|
sql_lines)
|
||||||
#generate the web2py code from the create statement
|
#generate the web2py code from the create statement
|
||||||
web2py_table_code = ''
|
web2py_table_code = ''
|
||||||
table_name = re.search(
|
table_name = re.search(
|
||||||
|
|||||||
Reference in New Issue
Block a user