[Fixed]-Making the first image select by default as featured from the modelformset_factory

1👍

To pre-check the radio button, pass the checked attribute to RadioSelect. To check an HTML radio button you would use:

<input type="radio" checked>

where checked is a Boolean attribute of the input element. So add an attrs dict to set the attribute:

widget = forms.RadioSelect(attrs={'checked': 'true'}, choices=((self.prefix, 'featured'),))

Leave a comment