forked from wiktor/spejstore-new
Remove unused select2 refs
This commit is contained in:
parent
4fc3629dcd
commit
e1a22100c4
|
@ -1,10 +1,8 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from django_select2.forms import Select2MultipleWidget
|
|
||||||
|
|
||||||
|
from .models import Item, ItemImage, Category, StaffProxyModel
|
||||||
from .models import Item, ItemImage, Category, Label, StaffProxyModel
|
|
||||||
|
|
||||||
from .widgets import PropsSelectWidget
|
from .widgets import PropsSelectWidget
|
||||||
|
|
||||||
|
@ -25,7 +23,6 @@ class ItemForm(forms.ModelForm):
|
||||||
model = Item
|
model = Item
|
||||||
exclude = []
|
exclude = []
|
||||||
widgets = {
|
widgets = {
|
||||||
"categories": Select2MultipleWidget,
|
|
||||||
"props": PropsSelectWidget,
|
"props": PropsSelectWidget,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +38,7 @@ class ItemAdmin(ModelAdminMixin, admin.ModelAdmin):
|
||||||
form = ItemForm
|
form = ItemForm
|
||||||
inlines = [ItemImageInline]
|
inlines = [ItemImageInline]
|
||||||
save_on_top = True
|
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"]
|
search_fields = ["name", "owner__name", "taken_by__name"]
|
||||||
|
|
||||||
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue