1
0
Fork 0

Remove unused select2 refs

This commit is contained in:
Dariusz Niemczyk 2023-08-04 17:46:08 +02:00
parent 4fc3629dcd
commit e1a22100c4
No known key found for this signature in database
1 changed files with 2 additions and 5 deletions

View File

@ -1,10 +1,8 @@
from django import forms
from django.contrib import admin
from django_select2.forms import Select2MultipleWidget
from .models import Item, ItemImage, Category, Label, StaffProxyModel
from .models import Item, ItemImage, Category, StaffProxyModel
from .widgets import PropsSelectWidget
@ -25,7 +23,6 @@ class ItemForm(forms.ModelForm):
model = Item
exclude = []
widgets = {
"categories": Select2MultipleWidget,
"props": PropsSelectWidget,
}
@ -41,7 +38,7 @@ class ItemAdmin(ModelAdminMixin, admin.ModelAdmin):
form = ItemForm
inlines = [ItemImageInline]
save_on_top = True
autocomplete_fields = ["parent", "owner", "taken_by"]
autocomplete_fields = ["parent", "owner", "taken_by", "categories"]
search_fields = ["name", "owner__name", "taken_by__name"]
def formfield_for_foreignkey(self, db_field, request, **kwargs):