def customer(self):
    return (self.subscription and self.subscription.account and self.
        subscription.account.customer)
How to specify table relationships in SQLAlchemy with multi-level/multiple joins?