I have the following:
class Person(Base):
__tablename__ = 'pessoa'
id = Column("id_person"), Integer, primary_key = True)
name = Column(String)
class Teacher(Person):
__tablename__ = 'teacher'
id = Column("id_teacher", Integer, ForeignKey(Person.id),
primary_key=True)
info = Column(String)
class Salary(Base):
__tablename__ = 'salary'
id = Column(String)
value = Column(Numeric)
That's ok, but I wanted to merge the Salary and Teacher objects following
the guide:
http://www.sqlalchemy.org/docs/06/orm/mapper_config.html#mapping-a-class-against-multiple-tables
Am I forced to map the Teacher and Salary in the non-declarative mode to
achieve this? It's nice to keep things declarative, because it automatically
create the __init__ method with the columns as parameters.
I have another classes that have relationships to those classes (and they
are declarative too), and things get nasty when I mix declarative with the
standard way.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.