I had them planted backing up against a timber fence, in a rectangular container about 3ft wide.
So I put in a series of small nails in the timber, 3ft apart, at maybe 12 -18 inch vertical intervals.
I then tied a length of fishing line between each set of nails, so I ended up with horizontal lengths of fishing line, spaced apart by 12-18 inches vertically.
Then as the sweet peas start shooting up, you keep tucking them in behind the fishing line, so you are training them up the fence.