CMS 3D CMS Logo

Classes | Functions
o2o_db_manager Namespace Reference

Classes

class  DbManager
 

Functions

def make_dbtype (base_class, schema=None)
 

Function Documentation

def o2o_db_manager.make_dbtype (   base_class,
  schema = None 
)

Definition at line 17 of file o2o_db_manager.py.

17 def make_dbtype(base_class, schema=None):
18  import re
19  name = re.sub('Def$', '', base_class.__name__)
20  members = {}
21  members['__tablename__'] = base_class.__tablename__
22  members['__table_args__'] = None
23  if schema:
24  name = name + schema
25  members['__table_args__'] = {'schema' : schema}
26  dbType = type(name, (_Base, base_class), members)
27  return dbType
28 
29 
def make_dbtype(base_class, schema=None)