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)
Beispiel #3
0
    def sync_score_code_row(legacy_row):
        new_score_code = ManualScoreCode(
            id=legacy_row[0], legacy_description=legacy_row[1].decode('utf8'))

        return update_or_save_object(command, new_score_code,
                                     recorded_score_codes, fields_to_compare)