mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 02:24:26 +00:00
Sli
7b41051d0d
* Don't tie the output name to webpack itself * Don't call js bundling webpack in python code * Make the doc more generic about js bundling
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
from pydantic import TypeAdapter
|
|
|
|
from core.views.widgets.select import AutoCompleteSelect, AutoCompleteSelectMultiple
|
|
from counter.models import Counter, Product
|
|
from counter.schemas import ProductSchema, SimplifiedCounterSchema
|
|
|
|
_js = ["bundled/counter/components/ajax-select-index.ts"]
|
|
|
|
|
|
class AutoCompleteSelectCounter(AutoCompleteSelect):
|
|
component_name = "counter-ajax-select"
|
|
model = Counter
|
|
adapter = TypeAdapter(list[SimplifiedCounterSchema])
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectMultipleCounter(AutoCompleteSelectMultiple):
|
|
component_name = "counter-ajax-select"
|
|
model = Counter
|
|
adapter = TypeAdapter(list[SimplifiedCounterSchema])
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectProduct(AutoCompleteSelect):
|
|
component_name = "product-ajax-select"
|
|
model = Product
|
|
adapter = TypeAdapter(list[ProductSchema])
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectMultipleProduct(AutoCompleteSelectMultiple):
|
|
component_name = "product-ajax-select"
|
|
model = Product
|
|
adapter = TypeAdapter(list[ProductSchema])
|
|
js = _js
|