improved scripts/extract_mysql_models.py, thanks Andre Kablu

This commit is contained in:
mdipierro
2013-07-19 17:42:15 -05:00
parent 92c33f6a2b
commit 650fec547b
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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
+3 -2
View File
@@ -79,8 +79,9 @@ def mysql(database_name, username, password):
if 'CREATE' in sql_create_stmnt: # check if the table exists
#remove garbage lines from sql statement
sql_lines = sql_create_stmnt.split('\n')
sql_lines = [x for x in sql_lines if not(
x.startswith('--') or x.startswith('/*') or x == '')]
sql_lines = filter(
lambda x: not(x in ('','\r') or x[:2] in ('--','/*')),
sql_lines)
#generate the web2py code from the create statement
web2py_table_code = ''
table_name = re.search(