2

I need to overwrite the javascript code of the library "django-autocomplete-light" to open a modal when the user selects the option to create. The installed libraries are:

  • Django==1.11
  • django-autocomplete-light==3.2.7

And my code is:

class SupplierAutocomplete(autocomplete.Select2QuerySetView):
    create_field = 'name'

    def get_queryset(self):
        qs = Supplier.objects.all()

    if self.q:
        qs = qs.filter(name__istartswith=self.q)

    return qs
direyes
  • 53
  • 4

0 Answers0