How do you change the default widget for all Django date fields in a ModelForm?

You can declare an attribute on your ModelForm class, called formfield_callback. This should be a function which takes a Django model Field instance as an argument, and returns a form Field instance to represent it in the form. Then all you have to do is look to see if the model field passed in is … Read more