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
2 answers

select2 - submit form on select

that might be a simple question, but I am not yet so firm with JavaScript. I want to have a search form with autocomplete using select2. When the user selects a result in the select2 dropdown box, I want to submit the search form right away so that…
3
votes
1 answer

creating linked lists in django admin for foreign keys

I have some chained foreign key relationships like this: class Continent(models.Model): continent = models.CharField(max_length=30) class Country(models.Model): country = models.CharField(max_length=30) continent =…
max
  • 9,708
  • 15
  • 89
  • 144
3
votes
0 answers

how to get object pk with django-autocomplete-light?

I'm trying to do and autocomplete field which will look through brand names, but will post the chosen object primary key as a result. So far I've got this, but it posts the name of the object to the form. How can I do it? class…
jarkow
  • 113
  • 11
3
votes
2 answers

Django Autocomplete Light limiting query results

When I register autocomplete_light.AutocompleteModelBase and use it in my form, the results that are shown are always limited to 20. I can't find any option in the docs to increase the number of results that gets displayed on the…
user1410712
  • 185
  • 1
  • 2
  • 10
3
votes
1 answer

django-autocomplete-light with crispy forms

I am trying to implement an autocomplete search on a foreignkey field in my form. I have been through the docs but not sure what I need to do to get it working. I just get the normal dropdown box on the foreignkey field. Here is my…
Mantis
  • 1,357
  • 3
  • 27
  • 49
3
votes
1 answer

how to create a dependant drop down using autocomplete light

I have created a form using Django Model Form and autocomplete_light. I want to filter the suggestions in the drop down list item according to the arguement passed when the class is called. My form is class CamenuForm(autocomplete_light.ModelForm): …
3
votes
0 answers

Django autocomplete light initial data

I have a form with Django autocomplete light working and saving fine. However, I also have a link to "Edit". I then pre-populate the form with the intial data that they've saved except that Django autocomplete light field's data is not being shown…
jeffci
  • 2,537
  • 6
  • 37
  • 59
3
votes
0 answers

django-autocomplete-light doesn't show 'add-another' button

I wasted a lot of time trying to solve this problem but didn't find any solution. I wanted to use django-autocomplete-light in Admin-interface not only selecting values existing in another table but adding new values. If I use it like this: class…
John_3234387
  • 53
  • 1
  • 5
3
votes
2 answers

Django Admin change_list filtering multiple ManyToMany

In the Django-Admin you have the possibility to define list_filter on fields of the model. This is working for ManyToMany-Fields as well. class ModelA(models.Model): name = models.CharField(max_length=100, verbose_name="Name") class…
2
votes
0 answers

Using django-autocomplete-light and django-addanother for the same field in a ModelForm

I'm trying to implement django-autocomplete-light and django-addanother for the same field in a ModelForm. I've tried the following: import floppyforms.__future__ as forms from .models import Worker from dal import autocomplete from…
Hofmann
  • 118
  • 1
  • 8
2
votes
3 answers

How to prevent Error: 403 in ModelAdmin.autocomplete_fields?

ModelAdmin.autocomplete_fields looks to be very simple to implement into the Django admin: class UserAdmin(admin.ModelAdmin): autocomplete_fields = ['material'] admin.site.register(User, UserAdmin) class MaterialAdmin(admin.ModelAdmin): …
2
votes
0 answers

Ajax data manipulation when transmitting to Django CBV

I'm using django-autocomplete-light with the select2 "select multiple" widget for a M2M form. I have it set up to enable "Create New" when the input is not found. However, my model has additional required fields beyond the initial input of the…
2
votes
1 answer

How to set the value of a django autocomplete light field dynamically using JQuery

I am using Django Autocomplete Light for some fields in my form. I have the need to automatically set the value of the field when the user performs a specific action. For example, if the user checks a certain box in the form, I want the selected…
2
votes
1 answer

Django Autocomplete Light - "The results could not be loaded"

I'm using Django-autocomplete-light on a small application. The UI seems to work, and I can select from some visible values. The problem arises when I type one or more letters into the box. Normally it should filter/select the results, instead, I…
2
votes
2 answers

How to get, change or clear a django-autocomplete-light field value with javascript

I'm using django-autocomplete-light and want to add action buttons do update/delete choices. So, I don't understand clearly how I can update/delete value and trigger change specific field. Is there a clear documentation about that somewhere ?
Akira
  • 160
  • 1
  • 12