Search code examples
pythondjangosqlitedictionarydjango-autocomplete-light

Django+autocomplete_light dynamic choiceField in form


I have a strange problem.

I don't know how I should even start doing it, my written english is really bad, so I can't really google it, because it seems complicated.

I'm doing a simple database web application using Django 1.7.1, I want to use autocomplete_light for autocompletion of some fields.

I'm using SQLite Database, in DB I have some "dictionary" tables, it means that user is likely to use some names multiple times in other records, so in "master" table, I store just id of that name. Is there any way of making such ChoiceFields and MultipleChoiceFields (for "reversed" situation), that if user will write new value (not stored in "dictionary" yet) in it, it will be automatically added to "dictionary" table?

I would be really thankful for any advices, or even suggestions where should I search such thing.


Solution

  • I did it as simple add another like in administration panel: http://django-autocomplete-light.readthedocs.org/en/stable-2.x.x/addanother.html