Questions tagged [django-select2]

Select2 jQuery plugin wrapped to Django Widget

This is a Django integration of Select2.

The app includes Select2 driven Django Widgets.

Select2 is already included to the distribution.

External Dependencies:

jQuery is not included in the package since it is expected that in most scenarios this would already be available.

https://django-select2.readthedocs.io/en/latest/ https://github.com/applegrew/django-select2

64 questions
4
votes
2 answers

Django-Select2 Heavy Widget

I was trying to implement Django-select2 for the first time.... I referred their documentation and some of the stack overflow solutions to implement it.... I managed to get ajax functionality work properly, also i am able to select multiple…
Praveen
  • 346
  • 1
  • 6
  • 18
4
votes
0 answers

Django - django-select2 doesn t work with inlineformset

I`ve made a inlineformset which contains a django-select2 field. The problem appears when I try to add another inline .The select2 data don't work on cloned field. This is my template: {{ form_m.management_form }} {% for m in form_m.forms…
Florin
  • 292
  • 2
  • 13
3
votes
1 answer

How to use django-select2 widgets in django admin site?

In my django app I have modified the User entity to include a worker field (OneToOneField). But from the django admin site that field yiels so many result , so it is difficult for the logged user to select a worker. Is there any way to use the…
3
votes
1 answer

Django Select2Widget not getting styled properly with crispy forms

I'm using the django-select2 package to implement Searchable Select on a ForeignKey field. I was successful in getting the functionality to work by following the steps mentioned in the docs but I am having trouble with the styling. To render my form…
rks
  • 542
  • 1
  • 3
  • 13
3
votes
0 answers

django-select2: Select Field doesn't open when tabbed

In my simple Django App, I've implemented django-select2. I have a form with 2 fields: product and category. When I create a new product I first give it a title and than tab to the category-field, but the dropdown does not open automatically. Only…
Checkson
  • 31
  • 3
3
votes
3 answers

ModelForm and ModelSelect2Widget (django-select2)

I have a ModelForm which includes a ModelSelect2Widget from django-select2 https://github.com/applegrew/django-select2 Following the Documentation from…
fuser60596
  • 1,087
  • 1
  • 12
  • 26
2
votes
1 answer

Django Select 2 Widget not working , Field rendered but styles not applied

I have been trying to use multiple select using django-select2 widget for a while Step-1: I installed django-select2 using pip install django-select2 Step-2: Added it the installed app INSTALLED_APPS = [ ... django_select2 ... ] Step-3: I added the…
Sanjay Kapilesh
  • 269
  • 1
  • 4
  • 16
2
votes
0 answers

Django, using select2 for choice field

Now that select2 is shipped in django for the autocomplete_fields feature, I have been looking for a way to use the select2 widget for a simple choice field which has many options. what's the current best way to do so?
nemesisdesign
  • 8,159
  • 12
  • 58
  • 97
2
votes
1 answer

Django Select2 not working for formset when click on add more

I'm creating a formset in which one of the field in select2 field and when i clicked on add more, i'm cloning that row. All the other columns are cloning but the select 2 is not displaying. function newSelect2WidgetInFormset (cell, prefix) { var…
2
votes
1 answer

Trying to combine Django inline-formset, django-select2 and django-dynamic-formset

I am trying to combine all mentioned in the title with always something missing. I've gone through all possible posts that I could find and still am not sure what to do. So I basically have two models, which are master-detail. When I use plain…
Branko Radojevic
  • 660
  • 1
  • 5
  • 14
2
votes
0 answers

Django_select2 : How to filter ModelSelect2Widget queryset with a request data? (Django_tables2 + Django_filter +Django_select2 )

I use django_tables2 with django_filter according to django_tables2 tutorial: #views.py from django_filters.views import FilterView from django_tables2.views import SingleTableMixin class FilteredCarListView(SingleTableMixin, FilterView): …
2
votes
1 answer

How to use django-filter with django-select2?

I want to implement a field with autocomplete input (django-select2) in the Filterset form (django-filter): import django_filters from django_select2.forms import Select2Widget from .models import Product class…
Vit Amin
  • 574
  • 5
  • 20
1
vote
0 answers

Django-Select2 Bootstrap5 Theme

I'm having a problem getting the Django-Select2 Bootstrap5 theme working. The select2 element is displaying the correct field from the DB, and my search function works correctly, it's just the theme aspect that's the…
David L
  • 11
  • 1
1
vote
0 answers

Django Select2 ModelSelect2TagWidget Problem

I followed the documentation on how to use the ModelSelect2TagWidget from the django-select2 library, but when I submit the form I get "Select a valid choice error" on the tag field regardless the tag is saved in the database. models.py class…
1
vote
1 answer

How to use chained django_select2 selects in django admin panel?

I took almost unchanged guide from documentation there is my models.py from django.db import models class Country(models.Model): name = models.CharField(max_length=255) class City(models.Model): name = models.CharField(max_length=255) …
1
2 3 4 5