Sift flour and salt in a mixing bowl and rub in fat until consistency is like breadcrumbs. Add water a spoonful at a time until a firm dough forms. Line a 18cm flan tin with pastry and bake blind for 15 minutes in the preheated oven.
Filling: Turn oven temperature down to 160 degrees C.
Slice onions and cook in butter until soft, but not brown. Mix cheese, onion and beaten eggs then pour into flan case. Season and arrange tomato slices on top. Bake for 30 minutes.