class documentation

class ThreeWayToggle(forms.ChoiceField):

View In Hierarchy

A toggle switch than can be in three different states: Positive/True, unkown/None and negative/False.

Method __init__ Pass the arguments, like label and tooltip to the constructor of the custom widget.
Method to_python Cast the string to an integer.
def __init__(self, attrs=None, option_attrs=None, label=None, tooltip=None, choices=None, initial=0, required=False, **kwargs):

Pass the arguments, like label and tooltip to the constructor of the custom widget.

def to_python(self, value):

Cast the string to an integer.