When I add the relationship below it displays the relationship list without
issuing a commit.
session.add(Relationship(source=george, target=martha,
relationship_type=marriage))
george.relationships
[Relationship Washington, George Washington, Martha (Marriage)]
But when I add this
(Date)
date_of_death = Column(Date)
relationships = relationship('Relationship',
foreign_keys='relationships.c.source_id')
__mapper_args__ = {
'polymorphic_identity': 'person'}
Missed the mapper args part of person.
On Thursday, April 17, 2014 10:02:54 AM UTC-7, Mats
class Entity(Base):
'''A base for entities.'''
__tablename__ = 'entities'
id = Column(Integer, Sequence('entity_id_seq'), primary_key=True)
type = Column(String(50))
tax_id = Column(String(20))
memberships = relationship('Membership')
-relationships-with-backref.
On Apr 17, 2014, at 1:04 PM, Mats Nordgren mats.n...@gmail.comjavascript:
wrote:
class Person(Entity):
'''A person.'''
__tablename__ = 'people'
id = Column(Integer, ForeignKey('entities.id'), primary_key=True)
first_name = Column