Preheat the oven to 200C / 390F and grease a pie tray (9" x 2" / 22.5cm x 3.1cm).
Heat oil in a small frying pan and cook the onion until translucent.
Combine 1 cup shredded cheddar cheese, parmesan cheese, ham, onion, flour, and pepper in a bowl, then pour into a pie dish.
Whisk eggs and milk together in a seperate bowl, then pour over the ingredients in the pie dish. Sprinkle the remaining shredded cheddar cheese on top.
Bake for 40 minutes or until golden and cooked through. Serve warm or cold.