Search code examples
pipdjango-autocomplete-light

DAL-script is different between the one in github and pip install


I am trying to follow the Django-autocomplete-light tutorial
However, when I try to run the test_project, I get the following error.

AttributeError: module 'dal.autocomplete' has no attribute 'Select2GenericForeignKeyModelField'

When I check the dal/autocomplete.py which was installed through pip command, I could not find any attribute Select2GenericForeignKeyModelField.
On the other hand, when I check the one in github, I could find this attribute.
I am guessing that the version which is in pip is older than the one in github.
Does anyone know how I can solve this problem?


Solution

  • The latest stable version is DAL 3.2.10, it was released at Aug 28, 2017 and Select2GenericForeignKeyModelField was added at Mar 30, 2018. It's not available even in pre-releases as the most recent pre-release now is 3.3.0rc6 released at Mar 6, 2018.

    It seems you have to use older API or install DAL from Github:

    pip install -U git+https://github.com/yourlabs/django-autocomplete-light#egg=django-autocomplete-light