We tend to plant carrots in large pots for the piggies. You never get carrot fly this way, but marigolds definitely work well
I have an allotment so everything is in the ground! I was actually more impressed by the size of my marigolds than the carrots last year!