def _buildFakeFKTable(cls, fakeTableName):
 countCols = 0
 attrs = {}
 for col in cls._imdbpySchema.cols:
  countCols += 1
  if (col.name == 'id'):
   continue
  if (not col.foreignKey):
   attrs[col.name] = MAP_COLS[col.kind](**col.params)
   continue
  thisColName = col.name
  if thisColName.endswith('ID'):
   thisColName = thisColName[:(-2)]
  fks = col.foreignKey.split('.', 1)
  foreignTableName = fks[0]
  if (len(fks) == 2):
   foreignColName = fks[1]
  else:
   foreignColName = 'id'
  fk = ForeignKey(foreignTableName, name=thisColName, default=None)
  attrs[thisColName] = fk
 newcls = type(fakeTableName, (SQLObject,), attrs)
 return newcls

def _buildFakeFKTable ( cls , fakeTableName ) : countCols = 0 attrs = { } for col in cls . _imdbpySchema . cols : countCols += 1 if ( col . name == 'id' ) : continue if ( not col . foreignKey ) : attrs [ col . name ] = MAP_COLS [ col . kind ] ( ** col . params ) continue thisColName = col . name if thisColName . endswith ( 'ID' ) : thisColName = thisColName [ : ( - 2 ) ] fks = col . foreignKey . split ( '.' , 1 ) foreignTableName = fks [ 0 ] if ( len ( fks ) == 2 ) : foreignColName = fks [ 1 ] else : foreignColName = 'id' fk = ForeignKey ( foreignTableName , name = thisColName , default = None ) attrs [ thisColName ] = fk newcls = type ( fakeTableName , ( SQLObject , ) , attrs ) return newcls
return a "fake" table .