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
3
votes
1 answer

django-autocomplete-light dependant filter over 3 models

I have 3 models. class FilterDefaultValues(BaseModel): value = models.CharField(max_length=255, null=True, blank=True) display_value = models.CharField(max_length=255, null=True, blank=True) class Filter(BaseModel): name =…
Mamed
  • 95
  • 4
  • 16
3
votes
0 answers

Autocomplete with Django + React

I'm creating a web app using Django Rest Framework for the backend and will use React for the frontend. I'd like to create a field where the user can enter the university they attend and want that to be a drop down/autocomplete search option (ex:…
3
votes
0 answers

django-autocomplete-light add parameter to query url (in version 3.5.1)

I'm using django-autocomplete-light in a django admin change_form.html page, however I need to change dynamically the GET parameters of the URL depending on another field. I have already tried to replicate this answer django-autocomplete-light add…
3
votes
1 answer

Django-autocomplete-light showing empty dropdown instead of autocomplete widget

I am trying to implement django-autocomplete-light in my projects but cannot figure out why it does not show me the autocomplete widget, but keeps showing an empty dropdown. I followed the tutorial:…
NinjaChris
  • 51
  • 6
3
votes
0 answers

Select2 - Doesn't show/deletes initial values

I use django-filter for filtering a Article queryset. Article has a field locations: locations = models.ManyToManyField('locations.Location', related_name='articles') I filter Articles by field locations and as a widget, I use…
Milano
  • 18,048
  • 37
  • 153
  • 353
3
votes
1 answer

Modifying CSS on django-autocomplete-light 3.1.3

I am currently learning Django Framework with django-autocomplete-light 3.1.3 and i can't find any way to change the css of a input field. In there documentation it is written that we can create our own HTML template de deal with the data but can we…
user9178882
3
votes
0 answers

How to order initial data in Django-autocomplete-light

I'd like to update many-to-many through model data using Django-autocomplete-light's ModelSelect2Multiple, but when sending data to the form with the get_initial(), the data is not displayed in the order of the data sent; it will be displayed in the…
nau
  • 31
  • 3
3
votes
1 answer

How to use "django-autocomplete-light" in inline form

I would like to use an inline model form with a 'django-autocomplete-light field'. I'm a little bit desperate also, because I don't know 'javascript' well. This is a picture of my form. At first glance, it works as desired: Unfortunately, only the…
3
votes
1 answer

How to change the option values with django-autocomplete-light?

I use django-autocomplete-light in a fairly standard way, simply following the tutorial on http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html. Whenever I use the Select2 widget, however, the values of the options are…
Private
  • 2,626
  • 1
  • 22
  • 39
3
votes
1 answer

Add CSS Class to Django-Autocomplete-Light ModelSelect2 Container/Selection

I have a model form that is made up largely of django-autocomplete-light ModelSelect2 boxes: class AlertForm(ModelForm): class Meta: model = Alert fields = '__all__' widgets = { 'entity':…
3
votes
1 answer

Combine django mptt TreeNodeChoiceField with django-autocomplete-light ModelSelect2 widget

A django-mptt TreeNodeChoiceField gives indented select options, whereas I can filter my results using django-autocomplete-light. However, the ModelSelect2 widget overwrites the rendered html, which removes the indentation. I would like to combine…
JIN
  • 647
  • 1
  • 7
  • 19
3
votes
1 answer

Django autocomplete with multiplechoice give me invalid form

I'm using django-autocomplete-light and I'm trying to make form like this: from dal import autocomplete class ReportForm(forms.Form): week_number = forms.MultipleChoiceField( choices=generate_week_numbers(), label=_("Week number"), …
Jeroj82
  • 401
  • 3
  • 14
3
votes
0 answers

Django auto complete light outside admin - not working

I trying to set up the django auto complete light outside the admin views. I am follow this tutorial but I havent got any luck in figure out whats is…
3
votes
1 answer

Django Autocomplete-Light allow any text input fields

I have Django Autocomplete-light running with Crispy Forms, but I need to allow users to enter any text into the form. At the moment the user can either select one of the options from the autocomplete dropdown, or nothing. Note that I am using the…
Stephen
  • 53
  • 1
  • 6
3
votes
2 answers

Django autocomplete does not work

I'm using django-autocomplete-light 3.2.1 in django 1.10.2. In admin instead of autocomplete field I see a select field. I followed the instructions from here. package urls.py urlpatterns = i18n_patterns( url(r'^admin/',…
Alex Sh.
  • 225
  • 4
  • 17
1 2
3
20 21