Incorporate pyteamsnap changes
This commit is contained in:
@@ -282,11 +282,11 @@ class OpponentFormView(FormView):
|
||||
return form
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
import pyteamsnap
|
||||
import pyteamsnap.objects
|
||||
|
||||
ts_client = get_teamsnap_client(self.request)
|
||||
context = super().get_context_data(**kwargs)
|
||||
opponent = pyteamsnap.api.Opponent.get(
|
||||
opponent = pyteamsnap.objects.Opponent.get(
|
||||
ts_client, self.kwargs.get("opponent_id")
|
||||
)
|
||||
context["opponent"] = opponent
|
||||
@@ -299,11 +299,11 @@ class Opponents(ListView):
|
||||
pass
|
||||
|
||||
def get_queryset(self):
|
||||
import pyteamsnap
|
||||
from pyteamsnap.objects import Opponent as TsOpponent
|
||||
|
||||
ts_client = get_teamsnap_client(self.request)
|
||||
team_id = self.kwargs.get("team_id")
|
||||
ts_opponents = pyteamsnap.api.Opponent.search(ts_client, team_id=team_id)
|
||||
ts_opponents = TsOpponent.search(ts_client, team_id=team_id)
|
||||
ts_opponents.sort(key=lambda t: t.data.get("name"))
|
||||
opponents = []
|
||||
for opponent in ts_opponents:
|
||||
|
||||
Reference in New Issue
Block a user