Removed use of table.description, add a _original_name to it instead

This commit is contained in:
Epithumia 2013-12-18 23:37:03 +01:00
parent 591d3bb4dd
commit 0d9d44ca03
2 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ def connect(uri=None, session_args={}, engine_args={}, engine_prefix=''):
# Easy solution : drop the vowels, differents words are unlikely to
# end up the same after the vowels are gone
for table in metadata.tables.values():
table.description = table.name[:]
table._orginal_name = table.name[:]
if len(table.name) > 30:
for letter in ['a', 'e', 'i', 'o', 'u', 'y']:
table.name=table.name.replace(letter,'')

View file

@ -147,12 +147,12 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s
# Shorten table names, Oracle limits table and column names to 30 chars
for table in table_objs:
tname = table.name[:]
oradict[tname]=table.description
if len(tname) > 30:
table._orginal_name = table.name[:]
oradict[table.name]=table._orginal_name
if len(table._orginal_name) > 30:
for letter in ['a', 'e', 'i', 'o', 'u', 'y']:
table.name=table.name.replace(letter,'')
oradict[tname]=table.description
oradict[table.name]=table._orginal_name
if recursive:
table_objs.extend(find_dependent_tables(table_objs))