I want to change the way that the "+" icon for the foreign key in the admin site is shown.
I found that the widget that prints the code is RelatedFieldWidgetWrapper
that is in django/contrib/admin/widgets.py
.
So I wrote my version of this class and I changed its render
function.
But now how can I use it? I mean... in the definition of my model do I have to use the formfield_overrides
in this way?
formfield_overrides = {
models.ForeignKey: {'widget': customRelatedFieldWidgetWrapper},
}
I think that this is not the right way, because that widget is not the one that manage the whole foreign key, but only the "+" icon. Am I wrong?
Thanks a lot.