How delete value from autocomplete field
Guys, I have problem - when I have foreign key in model, for which xadmin creates autocomplete choice field, when I choose something and save, I can't then delete value from that field. I can only change it to another choice from autocomplete list. But can't delete my choice to make it once again empty.
Does anybody have same problem ? How to fix it ?
I think, that this widget doesn't support ForeignKey with null=True and blank=True. I'm trying to figure out how fix it, but help will be appreciated :)
I think that possible are two solutions:
- First: add to choices list empty value, to let choose it or
- Add small "Clear" button near to widget, to clear selected choice
Still need help :)
PS. There are two widgets for FKs: dropdown list field and search autocomplete list. Problem is with that autocomplete widget.
Because I was unable to fix it, I changed widget for my FK field to xadmin.widgets.AdminSelectWidget, and for now it's fine for me.
You can close that ticket, but I think, that someone with bigger skills than mine, should fix it.