Dice 100 g butter and mix with 200 g flour and 1⁄2 TL salt to a crumbly dough. Add 6 tablespoons of cold water and knead quickly to a smooth dough. Form dough into a ball, wrap in foil and chill for about 30 minutes.
Peel the onion and cut into fine strips. Wash, peel and coarsely grate the beetroot (be careful to wear disposable gloves - it stains strongly!). Wash thyme and shake dry, pluck off leaves. Heat the oil in a pan. Sauté the onion in it. Add beetroot, thyme, 1 tablespoon sugar, vinegar and 5 tablespoons water. Simmer over medium heat for about 10 minutes. Season to taste with salt and pepper. Remove from heat.
Preheat oven (electric cooker: 180 °C/circulating air: 160 °C/gas: see manufacturer). Grease a springform pan (26 cm Ø) and dust with flour. Roll out the dough on a floured work surface until round (approx. 32 cm Ø), place in the form and press the edges together. Put baking paper in it and fill with dried peas. Pre-bake in a hot oven for about 10 minutes. Then remove the paper and peas, continue baking for about 10 minutes. Take out, let cool down a little in the tin.
Whisk eggs and sour cream, season with a little salt. Spread beetroot in the form, crumble feta over it. Pour egg icing over it. Bake in a hot oven for about 30 minutes. Take out, eat hot or cold. Garnish with spinach if desired.