ModelAdmin.formfield_overrides should look at field attributes
|Reported by:||zuber||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ModelAdmin.formfield_overrides should look at field attributes in addition to field class, when choosing which widget to use in template. The most important use case here is the choices attribute, as it's likely that user will want to render fields with choices differently (i.e. as select) than fields without choices (which can be a normal input).
After #19303 is merged, current mechanism will allow users to override widget choice for all fields with a certain class. It won't be possible to choose different widget for normal fields and fields with choices, short of overriding the ModelForm. That's not optimal.