yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.79k stars 467 forks source link

Add a possibility to have case-sensitive creates using Select2QuerySetView #1253

Closed shenek closed 3 years ago

shenek commented 3 years ago

Sometimes it desired to have a possibility to create case-sensitive options Select2QuerySetView.

For example image a situation when you are trying to use Select2QuerySetView to choose a unit (e.g. file size). These units are case-sensitive MB vs Mb. In current implementation it is not possible to create both Mb and MB in the search field.

This patch makes it easier to achieve such functionality by overriding Select2QuerySetView.

class CustomSelect2QuerySetView(Select2QuerySetView):
    case_sensitive_create = True