Cut the onions into small, thin, wedge-shaped pieces. Heat the oil in a large frying pan. Add the onions and fry over medium heat for about 20 minutes, stirring occasionally to allow them to caramelise.
Preheat the Oven to 190°C (170°C for fan ovens) or gas mark 5. For the dough, combine the flour and a pinch of salt. Add the butter to the bowl. Next, rub the flour and butter together until the mixture resembles crumbs.
In a separate container, mix the yoghurt and milk and then add to flour mixture. Mix to form dough. Remove the dough from the bowl and gently press it together to form a ball.
Roll the dough out thinly on a floured surface, line a 23cm round loose-based tin or pie dish with dough, pressing into the flutes of the dish.
Lastly, in a bowl, beat eggs, stir in crème fraîche, thyme, mustard and seasoning. Spoon half the onions into the lined base of tin. Season with pepper. Scatter with cheese.
Pour egg mixture over the onions and cheese. Scatter the rest of the onions and cheese on top. Bake for 25–30 minutes until the base and filing are cooked.