From 0d9d44ca037c564a48c38b81c9bf58ed5c96923d Mon Sep 17 00:00:00 2001 From: Epithumia Date: Wed, 18 Dec 2013 23:37:03 +0100 Subject: [PATCH] Removed use of table.description, add a _original_name to it instead --- pokedex/db/__init__.py | 2 +- pokedex/db/load.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pokedex/db/__init__.py b/pokedex/db/__init__.py index 37b3746..0bb1705 100644 --- a/pokedex/db/__init__.py +++ b/pokedex/db/__init__.py @@ -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,'') diff --git a/pokedex/db/load.py b/pokedex/db/load.py index 782c19e..bc52578 100644 --- a/pokedex/db/load.py +++ b/pokedex/db/load.py @@ -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))