Sith/club/widgets/select.py

24 lines
590 B
Python
Raw Normal View History

from pydantic import TypeAdapter
2024-10-20 18:55:05 +00:00
from club.models import Club
from club.schemas import ClubSchema
from core.views.widgets.select import AutoCompleteSelect, AutoCompleteSelectMultiple
_js = ["webpack/club/components/ajax-select-index.ts"]
2024-10-20 18:55:05 +00:00
class AutoCompleteSelectClub(AutoCompleteSelect):
2024-10-20 18:55:05 +00:00
component_name = "club-ajax-select"
model = Club
adapter = TypeAdapter(list[ClubSchema])
2024-10-20 18:55:05 +00:00
js = _js
2024-10-20 18:55:05 +00:00
class AutoCompleteSelectMultipleClub(AutoCompleteSelectMultiple):
2024-10-20 18:55:05 +00:00
component_name = "club-ajax-select"
model = Club
adapter = TypeAdapter(list[ClubSchema])
2024-10-20 18:55:05 +00:00
js = _js