Multiwidget shows nothing with ModelChoiceField

Hi, I currently have a season_start and season_end in a form and it works.

season_start = forms.ModelChoiceField(
     label='Season start',
     required=False,
     queryset=SeasonMaster.objects.all(),
     widget=forms.Select(
        attrs={
             'class': 'form-control w-25',
         },
     ),
 )

season_end = forms.ModelChoiceField(
     label='Season end',
     required=False,
     queryset=SeasonMaster.objects.all(),
     widget=forms.Select(
        attrs={
             'class': 'form-control w-25 add-tilde',
         },
     ),
 )

But I would like them to be displayed side by side. However, when I tried putting them together as such nothing is showing from the drop down values.

season = forms.ModelChoiceField(
    label='Season',
    required=False,
    queryset=None,
    widget=forms.MultiWidget(
        widgets=(
            forms.Select(
                attrs={
                    'class': 'form-control w-25',
                },
            ),
            forms.Select(
                attrs={
                    'class': 'form-control w-25 add-tilde',
                },
            ),
        ),
    ),
)

Any idea on what I should do? Thanks!

This isn’t something you would do at the field or widget level, it’s something done within the template. You want to render those fields with CSS such that they appear adjacent.

The MultiWidget is used when you want to have multiple widgets accepting input to create a single field. (Such as the “date” and “time” components of a DateTime field.)

Got it, I’ll adjust them at the CSS. Thanks.