@hybrid_property
def time_spent(self):
    return sum((i.time_spent for i in self.intervals), timedelta(0))

@time_spent.expression
def hours_spent(cls):
    pass
How do I implement a null coalescing operator in SQLAlchemy?