Search code examples
pythondjangoautocompletedjango-admindjango-autocomplete-light

Autocomplete a specific set of possibilities in Django-admin


I have a field in a Django model, and I want there to be a small (~20) set of possibilities (which are strings) which can be autocompleted (preferably with django-autocomplete-light, which I am using already) in django-admin. Should I make this a foreign key field and create a model containing just these 20 possibilities? or is there a better way?


Solution

  • The only way to do this is to have a separate model with only those possibilities and to make the field we want to limit into a foreign key field.