mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-15 10:43:22 +00:00
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
|
from django.forms import Select, SelectMultiple
|
||
|
|
||
|
from core.views.widgets.select import AutoCompleteSelectMixin
|
||
|
from counter.models import Counter, Product
|
||
|
from counter.schemas import ProductSchema, SimplifiedCounterSchema
|
||
|
|
||
|
|
||
|
class CounterAutoCompleteSelectMixin(AutoCompleteSelectMixin):
|
||
|
js = [
|
||
|
"webpack/counter/components/ajax-select-index.ts",
|
||
|
]
|
||
|
|
||
|
|
||
|
class AutoCompleteSelectCounter(CounterAutoCompleteSelectMixin, Select):
|
||
|
component_name = "counter-ajax-select"
|
||
|
model = Counter
|
||
|
schema = SimplifiedCounterSchema
|
||
|
|
||
|
|
||
|
class AutoCompleteSelectMultipleCounter(CounterAutoCompleteSelectMixin, SelectMultiple):
|
||
|
component_name = "counter-ajax-select"
|
||
|
model = Counter
|
||
|
schema = SimplifiedCounterSchema
|
||
|
|
||
|
|
||
|
class AutoCompleteSelectProduct(CounterAutoCompleteSelectMixin, Select):
|
||
|
component_name = "product-ajax-select"
|
||
|
model = Product
|
||
|
schema = ProductSchema
|
||
|
|
||
|
|
||
|
class AutoCompleteSelectMultipleProduct(CounterAutoCompleteSelectMixin, SelectMultiple):
|
||
|
component_name = "product-ajax-select"
|
||
|
model = Product
|
||
|
schema = ProductSchema
|