first commit

This commit is contained in:
2021-11-20 16:15:29 -06:00
commit 2e9ec4e70a
10 changed files with 2705 additions and 0 deletions

21
teamsnap/models.py Normal file
View File

@@ -0,0 +1,21 @@
from dataclasses import dataclass
from typing import Optional
from teamsnap.api import TeamSnap
from urllib.parse import urljoin
class Item:
id: int
type: str
data: dict = {}
def __init__(self, client:TeamSnap, rel, id, data: dict = {}):
self._client = client
self.type = rel
self.id = id
self._data = data
@property
def data(self):
if self._data: return self._data
else:
return self._client.get_item(self.type, self.id)