mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Fix readability and avoid instantiating too many TypeAdapter
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
from pydantic import TypeAdapter
|
||||
|
||||
from club.models import Club
|
||||
from club.schemas import ClubSchema
|
||||
from core.views.widgets.select import AutoCompleteSelect, AutoCompleteSelectMultiple
|
||||
@ -8,7 +10,7 @@ _js = ["webpack/club/components/ajax-select-index.ts"]
|
||||
class AutoCompleteSelectClub(AutoCompleteSelect):
|
||||
component_name = "club-ajax-select"
|
||||
model = Club
|
||||
schema = ClubSchema
|
||||
adapter = TypeAdapter(list[ClubSchema])
|
||||
|
||||
js = _js
|
||||
|
||||
@ -16,6 +18,6 @@ class AutoCompleteSelectClub(AutoCompleteSelect):
|
||||
class AutoCompleteSelectMultipleClub(AutoCompleteSelectMultiple):
|
||||
component_name = "club-ajax-select"
|
||||
model = Club
|
||||
schema = ClubSchema
|
||||
adapter = TypeAdapter(list[ClubSchema])
|
||||
|
||||
js = _js
|
||||
|
Reference in New Issue
Block a user