2024-10-28 17:08:13 +00:00
|
|
|
from pydantic import TypeAdapter
|
|
|
|
|
2024-10-21 11:26:11 +00:00
|
|
|
from accounting.models import ClubAccount, Company
|
|
|
|
from accounting.schemas import ClubAccountSchema, CompanySchema
|
2024-10-21 14:14:00 +00:00
|
|
|
from core.views.widgets.select import AutoCompleteSelect, AutoCompleteSelectMultiple
|
|
|
|
|
2024-11-18 14:36:05 +00:00
|
|
|
_js = ["bundled/accounting/components/ajax-select-index.ts"]
|
2024-10-21 11:26:11 +00:00
|
|
|
|
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
class AutoCompleteSelectClubAccount(AutoCompleteSelect):
|
2024-10-21 11:26:11 +00:00
|
|
|
component_name = "club-account-ajax-select"
|
|
|
|
model = ClubAccount
|
2024-10-28 17:08:13 +00:00
|
|
|
adapter = TypeAdapter(list[ClubAccountSchema])
|
2024-10-21 11:26:11 +00:00
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
js = _js
|
2024-10-21 11:26:11 +00:00
|
|
|
|
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
class AutoCompleteSelectMultipleClubAccount(AutoCompleteSelectMultiple):
|
2024-10-21 11:26:11 +00:00
|
|
|
component_name = "club-account-ajax-select"
|
|
|
|
model = ClubAccount
|
2024-10-28 17:08:13 +00:00
|
|
|
adapter = TypeAdapter(list[ClubAccountSchema])
|
2024-10-21 11:26:11 +00:00
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
js = _js
|
2024-10-21 11:26:11 +00:00
|
|
|
|
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
class AutoCompleteSelectCompany(AutoCompleteSelect):
|
2024-10-21 11:26:11 +00:00
|
|
|
component_name = "company-ajax-select"
|
|
|
|
model = Company
|
2024-10-28 17:08:13 +00:00
|
|
|
adapter = TypeAdapter(list[CompanySchema])
|
2024-10-21 11:26:11 +00:00
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
js = _js
|
2024-10-21 11:26:11 +00:00
|
|
|
|
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
class AutoCompleteSelectMultipleCompany(AutoCompleteSelectMultiple):
|
2024-10-21 11:26:11 +00:00
|
|
|
component_name = "company-ajax-select"
|
|
|
|
model = Company
|
2024-10-28 17:08:13 +00:00
|
|
|
adapter = TypeAdapter(list[CompanySchema])
|
2024-10-21 11:26:11 +00:00
|
|
|
|
2024-10-21 14:14:00 +00:00
|
|
|
js = _js
|