Preheat oven to 375 degrees
Place pie shell on a baking sheet and line with foil. Pour pie weights or dried beans over foil. Bake for 10 minutes. Remove weights and foil and bake pie shell for another 7-8 minutes. Remove from oven and reserve.
In a medium saute pan, melt butter and add the onions. Cook over medium low heat, stirring every 5 minutes until onions are deeply caramelized. Reserve.
Meanwhile, divide the tomatoes in half. Place half of the tomatoes in a colander and toss with 1.2 tsp salt and the sugar. Place colander in a large bowl to collect the juices and set aside for at least 30 minutes.
On a parchment lined baking sheet, toss the other half of the tomatoes with olive oil, tomato paste, 1/2 teaspoon salt and the thyme. Make sure the tomatoes are in a single layer, and roast in the oven for 30 minutes.
For the topping, combine the mayo, and cheeses. Set aside.
In a large bowl, combine the fresh tomatoes, roasted tomatoes, onions, basil, ground black pepper and a pinch more of salt.
Spoon filling into the blind baked pie shell and top with cheese / mayo topping. Spread evenly and carefully.
Bake for another 30 minutes on the middle rack in the oven until topping is golden brown.