In a medium frying pan, sauté onions in olive oil with a good pinch of sugar over medium-low heat, stirring occasionally until wilted and caramelized. Season with a pinch of salt and pepper.
Meanwhile, in a small saucepan over medium heat, mash the squash until smooth. Thin with a little water to a spreadable consistency. Season to taste with salt, pepper, butter and cayenne pepper (if desired).
Place flatbreads on a baking sheet and bake for about 5 minutes, or until desired level of crispness is reached.
Remove flatbread from oven, spread with half the mashed squash, and top with half the onions and feta. Repeat with remaining ingredients for second flatbread. Cut into wedges and serve.