From 8ff082611a3cb376980487f18ec608e4e968a808 2012-08-10 13:47:33 From: Lance Edgar Date: 2012-08-10 13:47:33 Subject: [PATCH] comment out some batch code (for now?) --- diff --git a/rattail/db/__init__.py b/rattail/db/__init__.py index 034d3e56ee304c327c93d829ab25de68469b1cca..db384279f6d7088e33731ae93f15a27e1d7c2bcd 100644 --- a/rattail/db/__init__.py +++ b/rattail/db/__init__.py @@ -27,7 +27,7 @@ """ import edbob -from edbob.db.extensions import activate_extension +# from edbob.db.extensions import activate_extension import rattail @@ -44,58 +44,58 @@ def init(config): edbob.graft(rattail, enum) -def init_database(engine, session): - """ - Initialize an ``edbob`` database for use with Rattail. - """ +# def init_database(engine, session): +# """ +# Initialize an ``edbob`` database for use with Rattail. +# """ - activate_extension('rattail', engine) +# activate_extension('rattail', engine) - columns = [ - ('F01', 'UPC', 'GPC(14)'), - ('F02', 'Description', 'CHAR(20)'), - ('F03', 'Department Number', 'NUMBER(4,0)'), - ('F22', 'Size', 'CHAR(30)'), - ('F155', 'Brand', 'CHAR(30)'), - ('F238', 'Department Name', 'CHAR(30)'), - ] +# columns = [ +# ('F01', 'UPC', 'GPC(14)'), +# ('F02', 'Description', 'CHAR(20)'), +# ('F03', 'Department Number', 'NUMBER(4,0)'), +# ('F22', 'Size', 'CHAR(30)'), +# ('F155', 'Brand', 'CHAR(30)'), +# ('F238', 'Department Name', 'CHAR(30)'), +# ] - for name, disp, dtype in columns: - session.add(rattail.SilColumn( - sil_name=name, display=disp, data_type=dtype)) - session.flush() +# for name, disp, dtype in columns: +# session.add(rattail.SilColumn( +# sil_name=name, display=disp, data_type=dtype)) +# session.flush() - dictionaries = [ - ('DEPT_DCT', 'Department', [ - ('F03', True), - 'F238', - ]), - ('ITEM_DCT', 'Product', [ - ('F01', True), - 'F02', - 'F03', - 'F22', - 'F155', - ]), - # ('PRICE_DCT', 'Price', []), - # ('FCOST_DCT', 'Future Cost', []), - # ('FSPRICE_DCT', 'Future Sale Price', []), - # ('CLASS_GROUP', 'Scale Class / Group', []), - # ('NUTRITION', 'Scale Nutrition', []), - # ('SCALE_TEXT', 'Scale Text', []), - # ('VENDOR_DCT', 'Vendor', []), - ] +# dictionaries = [ +# ('DEPT_DCT', 'Department', [ +# ('F03', True), +# 'F238', +# ]), +# ('ITEM_DCT', 'Product', [ +# ('F01', True), +# 'F02', +# 'F03', +# 'F22', +# 'F155', +# ]), +# # ('PRICE_DCT', 'Price', []), +# # ('FCOST_DCT', 'Future Cost', []), +# # ('FSPRICE_DCT', 'Future Sale Price', []), +# # ('CLASS_GROUP', 'Scale Class / Group', []), +# # ('NUTRITION', 'Scale Nutrition', []), +# # ('SCALE_TEXT', 'Scale Text', []), +# # ('VENDOR_DCT', 'Vendor', []), +# ] - for name, desc, cols in dictionaries: - bd = rattail.BatchDictionary(name=name, description=desc) - for col in cols: - key = False - if not isinstance(col, basestring): - col, key = col - q = session.query(rattail.SilColumn) - q = q.filter(rattail.SilColumn.sil_name == col) - col = q.one() - bd.columns.append( - rattail.BatchDictionaryColumn(sil_column=col, key=key)) - session.add(bd) - session.flush() +# for name, desc, cols in dictionaries: +# bd = rattail.BatchDictionary(name=name, description=desc) +# for col in cols: +# key = False +# if not isinstance(col, basestring): +# col, key = col +# q = session.query(rattail.SilColumn) +# q = q.filter(rattail.SilColumn.sil_name == col) +# col = q.one() +# bd.columns.append( +# rattail.BatchDictionaryColumn(sil_column=col, key=key)) +# session.add(bd) +# session.flush()