Photograph: Karen Thomas
First make the pastry. Put the flour and a pinch of salt in a food processor. Add the butter and process in short bursts until the mixture forms fine crumbs. Tip the crumbs into a mixing bowl. Using a fork, mix in about 3 tablespoons of cold water. You want the crumbs to form themselves into larger balls of dough. If the dough is too dry, it will be crumbly when cooked. If it is too wet, it will shrink when it is baked and will have a more brittle texture. Place the dough on a lightly floured surface and gently knead into a ball. It can be frozen at this stage. Otherwise, roll out as needed. Loosely roll the pastry around the rolling pin, lift it over the tart tin or pie, and then carefully unroll. Cover and chill for 30 minutes (or longer if you like) before baking.
Roll out the pastry quite thinly on a lightly floured surface and line a 23cm shallow quiche dish. Cut off the excess and prick the base of the pastry, line with greaseproof paper or foil and fill with baking beans. Chill for 30 minutes. Preheat the oven to 200°C, fan 180°C, gas 6.
Bake the pastry case in the preheated oven for 15 minutes, then remove the paper or foil and beans and return to the oven for a further 5 minutes.
Meanwhile, place a nonstick frying pan over a medium heat. Add the oil and, once hot, gently fry the onions for 20 minutes, or until soft and golden. Season to taste and spoon into the pastry case.
Beat together the egg, egg yolk and soured cream. Season to taste and pour into the pastry case, mixing it with a fork into the onion. Sprinkle with the cheese and bake for 25 minutes, or until golden and set. Serve the tart warm or cold.
Kitchen secret: when making the pastry, don't over-process the butter and flour into a paste or the pastry will be too crumbly once cooked.
Recipe adapted from The Great British Vegetable Cookbook by Sybil Kapoor, published by National Trust Books