Django RadioSelect Patching

December 30, 2011 06:09

I had to change up the standard Django RadioSelect form widget today because I didn't want the label tags wrapping the input like it usually does. This is normally okay (and semantically fine), but the label wrap can be difficult to style when using it in a list. It was a bit confusing at first but generally simple once I figured it all out.

A couple good links that helped were here:

Here's a gist with what I did:

view raw gistfile1.py This Gist brought to you by GitHub.

I am just getting the hang of Django widgets, so if there is a better way of doing this then let me know! @dsmith1024.