Network.n_failed_nodes = column_property(
    select(func.count(Node.id))
    .where(
        Node.network_id == Network.id,
        Node.failed,