1👍
✅
Django needs the name of the field to match the class definition. Otherwise it wouldn’t be possible to process the submitted form data. Your only way of changing the widget’s name attribute is to change the form field definition.
You didn’t say why you want the name attribute to change. If you really wanted to hack it. You could create a custom widget with a template that uses the desired name.
👤jnns
Source:stackexchange.com