mirror of
https://github.com/ae-utbm/sith.git
synced 2025-03-14 01:07:12 +00:00
43 lines
1.1 KiB
Python
43 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.ajax_select import (
|
|
AutoCompleteSelect,
|
|
AutoCompleteSelectMultiple,
|
|
)
|
|
|
|
_js = ["bundled/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
|