Beispiel #1
0
    def __init__(self, key, **kwargs):
        kwargs["queryset"] = ManualScoreCode.get_codes(key)

        if "widget" not in kwargs:
            kwargs["widget"] = forms.CheckboxSelectMultiple(attrs={"class": "keyable"})

        super(MultiScoreField, self).__init__(**kwargs)
Beispiel #2
0
    def __init__(self, key, **kwargs):
        choices = []
        for code in ManualScoreCode.get_codes(key):
            choices.append((code.pk, str(code)))

        choices.append((IMPOSSIBLE, "Impossible to judge"))
        kwargs["choices"] = choices

        kwargs["coerce"] = _coerce_to_manualscorecode

        if "required" not in kwargs:
            kwargs["required"] = True

        if "widget" not in kwargs:
            kwargs["widget"] = forms.RadioSelect(attrs={"class": "keyable"})

        super(SingleScoreField, self).__init__(**kwargs)