Hi,

I've got a joined inheritance :

class Task(Base):
   __tablename__ = 'task'
   id = Column(Integer, primary_key=True)

class Invoice(Task):
  __tablename__ = 'invoice'
   id = Column(ForeignKey("task.id"))

When I delete an invoice, the associated task is also deleted, that's ok.

I've got a model TaskStatus related to the Task object and I'd like all
related status to be deleted when I delete an invoice:

class TaskStatus(Base):
  __tablename__ = 'task_status'
  id = Column(Integer, primary_key=True)
  task_id = Column(ForeignKey("task.id"))
  task = relationship("Task", backref=backref("statuses", cascade="all,
delete-orphan"))        

How could I achieve that one ?

Regards,

Gaston

-- 
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.

Reply via email to