No, there is no hook to redefine formfield widgets for the entire project.
You can make all classes of the model class inherited from the admin.ModelAdmin
subclass, then you only need to set formfield_overrides
once.
class MyModelAdmin(admin.ModelAdmin): """ This is the parent class that all model admins in the project inherit from """ formfield_overrides = { TextField: {'widget': CustomTextFieldWidget}, } class AppleAdmin(MyModelAdmin): ... class BananaAdmin(MyModelAdmin): ...
Alasdair
source share