mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 19:14:30 +00:00
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from pydantic import TypeAdapter
|
|
|
|
from accounting.models import ClubAccount, Company
|
|
from accounting.schemas import ClubAccountSchema, CompanySchema
|
|
from core.views.widgets.select import AutoCompleteSelect, AutoCompleteSelectMultiple
|
|
|
|
_js = ["webpack/accounting/components/ajax-select-index.ts"]
|
|
|
|
|
|
class AutoCompleteSelectClubAccount(AutoCompleteSelect):
|
|
component_name = "club-account-ajax-select"
|
|
model = ClubAccount
|
|
adapter = TypeAdapter(list[ClubAccountSchema])
|
|
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectMultipleClubAccount(AutoCompleteSelectMultiple):
|
|
component_name = "club-account-ajax-select"
|
|
model = ClubAccount
|
|
adapter = TypeAdapter(list[ClubAccountSchema])
|
|
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectCompany(AutoCompleteSelect):
|
|
component_name = "company-ajax-select"
|
|
model = Company
|
|
adapter = TypeAdapter(list[CompanySchema])
|
|
|
|
js = _js
|
|
|
|
|
|
class AutoCompleteSelectMultipleCompany(AutoCompleteSelectMultiple):
|
|
component_name = "company-ajax-select"
|
|
model = Company
|
|
adapter = TypeAdapter(list[CompanySchema])
|
|
|
|
js = _js
|