They now should have the proper parents:: >>> philosophy.courses['1'].__name__ u'1' >>> philosophy.courses['1'].__parent__ is philosophy.courses True """ from megrok import rdb from sqlalchemy import Column, ForeignKey from sqlalchemy.types import Integer, String from sqlalchemy.orm import relation metadata = rdb.MetaData() rdb.metadata(metadata) class Courses(rdb.Container): pass class Department(rdb.Model): id = Column('id', Integer, primary_key=True) name = Column('name', String(50)) courses = relation('Course', backref='department', collection_class=Courses)
class MyClass(rdb.Model): rdb.metadata(rdb.MetaData()) rdb.tableargs(schema='bar') id = Column(Integer, primary_key=True)
class MyClass(rdb.Model): rdb.metadata(rdb.MetaData()) rdb.tableargs(ForeignKeyConstraint(['id'], ['whah.id']), schema='bar') id = Column(Integer, primary_key=True)
class MyClass(rdb.Model): rdb.metadata(rdb.MetaData()) id = Column(Integer, primary_key=True)