Questions tagged [django-autocomplete-light]

django-autocomplete-light is an open source app that provides a new approach to auto-complete implementations, specially for Django.

django-autocomplete-light is an open source app that provides a new approach to auto-complete implementations, specially for . It ships its own auto-complete script, which is different because:

  • it expects the auto-complete to be rendered on the server side, which makes any kind of customization much simpler,
  • it doesn't take any action when a choice is selected. Instead it just triggers a event, which makes it usable for any kind of purpose.

It is also called django-autocomplete-light because the Python API relies on Django widgets and no hack. This makes it portable and usable in any Django form, including in the admin.

Resources

Resource list is maintained in the README.

303 questions
18
votes
1 answer

django-autocomplete-light simple usage

I am trying to understand how to use django-autocomplete-light for an existing project. This seems like a good autocomplete solution for django for which I am already using normal ModelChoiceFields. So, let's say that I have a Model named MyModel…
Serafeim
  • 14,962
  • 14
  • 91
  • 133
13
votes
3 answers

how to create a autocomplete input field in a form using Django

I am pretty new to django and its ways. I am trying to create an autocomplete field for a form. My code is as below forms.py from django import forms class LeaveForm(forms.Form): leave_list = ( ('Casual Leave', 'Casual Leave'), …
9
votes
2 answers

django-autocomplete-light tutorial: select2 is not a function error

I was having trouble while using dal and tried to build a simple example. I did almost the exactly the same as Django autocomplete light: field not populated and also applied the answer of the link. Here are the steps I went through: Step 1) When I…
RENO
  • 1,225
  • 1
  • 10
  • 10
9
votes
2 answers

Django autocomplete Light in list filters for admin

I have successfully setup the Autocomplete Registry and have my django admin forms where if you go to the form, the auto completes works. I would like to be able to extend the autocompletes to work on the list_filter view as well. So when you are…
8
votes
1 answer

django-autocomplete-light displays empty dropdown in the form

I am trying to use django-autocomplete-light From this tutorial https://github.com/yourlabs/django-autocomplete-light/blob/master/docs/tutorial.rst I Installed it with pip and added it to my settings file INSTALLED_APPS = ( 'dal', …
Ilya Bibik
  • 3,924
  • 4
  • 23
  • 48
7
votes
3 answers

Django Autocomplete Light create new choice

I have been working through the following tutorial provided for Django Autocomplete Light: https://django-autocomplete-light.readthedocs.io/en/master/tutorial.html I have successfully implemented autocompletion for one of the fields in my form,…
7
votes
2 answers

How to use django-autocomplete-light

How do I use django_autcomplete_light to add autocomplete to one field in a form. I have a form which is based off of a model, and I want to add autocomplete to the firstname field. I have done the following so far: Install…
abden003
  • 1,325
  • 7
  • 24
  • 48
6
votes
1 answer

django-autocomplete-light initial data using Select2 widget

I have a form field with autocomplete (using django-autocomplete-light app and Select2 widget), which serve as a search filter and it works as expected. When I submit the form and search results are listed, I would like to set this form field…
6
votes
2 answers

django-autocomplete-light add parameter to query url

I'm trying to pass some data along to the autocomplete_light.AutocompleteModelBase so I can exclude some models from the search. I'm trying to use the Dependencies info in the docs here but I can seem to get it. The id of the input is…
Rob L
  • 3,634
  • 2
  • 19
  • 38
6
votes
1 answer

django-autocomplete-light default load a previously saved value?

I have a working implementation of autocomplete_light in my django project, pulling values from cities_light in a dropdown, which correctly saves the foreign key to the field in the db on form submit. When I revisit the form, I would like for the…
5
votes
2 answers

How to capture on change event on Django Autocomplete Light widget using jQuery

I am using Django Autocomplete Light (DAL) in my application. In order to do some post-processing in the background on user selection, I am trying to capture the .on('change') event (when DAL select field choice is changed) using jQuery (like we do…
5
votes
1 answer

Django Throttling Not Working on Production mode

I'm using DJANGO REST FRAMEWORK to protect my API. Django Throttling that limits the number of requests on an API for Anonymous and authenticates Users. The throttling is not working on production mode. By the way, I'm using Ubuntu and Nginx server…
5
votes
2 answers

override __str__(self) of a model from an imported app

I'm facing the following situation: I have a django project, which uses an outside app [App1]. Within App1, it has the following structure: abstract class 'Base': class Base(models.Model): """ Base model with boilerplate for all models. …
Michael Xu
  • 188
  • 3
  • 11
5
votes
1 answer

Django Autocomplete Light List Object has no Attribute Queryset

Please look at my edits at the end of my code as well. I'm attempting to implement django-autocomplete-light (dal 3.2.10) for a single field. Following the tutorial, I turn up this error: 'list' object has no attribute 'queryset'. I have seen this…
5
votes
1 answer

django admin and autocomplete light: Select2: An instance of jQuery or a jQuery-compatible library was not found

Autocomplete light widget doesn't load completely for the field i'm trying to code it on in admin. Instead, I get the following Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery…
1
2 3
20 21