DjangoAdmin: How to keep the '+✎ ✕' buttons for a Foreign Key on when using `AutocompleteSelect` widget

Viewed 108

I'm using the AutocompleteSelect widget for a ForeignKey field. To do this, I override the default Admin Form using the ModelForm class like this:

class ContainerModelForm(forms.ModelForm):
    ...
    some_fk = forms.ModelChoiceField(
        queryset=SomeModel.objects.all(),
        widget=AutocompleteSelect(ContainerModel.some_fk.field.remote_field, admin.site)
    )

However, by using this widget I lose the + ✎ ✕ buttons that are available on the Django Admin interface for a Foreign Key field by default.

enter image description here

What will be a good way to use AutoCompleteSelect widget but also keeping these Add/Edit/Delete buttons besides the foreign key field on the Admin UI?

1 Answers
Related