Django bug - Dual display of the CheckboxSelectMultiple widget label

forms.py

class LegacyForm(forms.ModelForm):
    class Meta:
        model = Legacy
        fields = [
            'app_should_include',
        ]

    app_should_include = forms.MultipleChoiceField(
        choices=APP_SHOULD_INCLUDE_LEGACY.items(),
        widget=forms.CheckboxSelectMultiple,
        label='App should include :',
    )

models.py

class Legacy(models.Model):
    app_should_include = ArrayField(
        models.CharField(
            choices=APP_SHOULD_INCLUDE.items(),
            max_length=24,
            blank=True,
        ),
    )

enter image description here

When I replace the label value with “okokokokokokokok:”, both labels are changed to “okokokokokokokok:”.

enter image description here

forms.py

app_should_include = forms.MultipleChoiceField(
        choices=APP_SHOULD_INCLUDE_LEGACY.items(),
        widget=forms.CheckboxSelectMultiple,
        label='okokokokokokokok :',
    )

But the problem is that I only want one label.

Can anyone help me fix this problem?

Вернуться на верх