def choices_to_dict(t):
    """
    Converts a ChoiceField two-tuple to a dict (for JSON)
    Assumes i[0][0] is always unique
    """
    d = {}
    for i in t:
        k = str(i[0])
        d[k] = i[1]

    return d