consolidated objects into one benchcoach app

created benchcoachproject app to contain all the settings and stuff
some other changes that got grouped with this commit is the adding the ApiObject to the TeamSnap object model
This commit is contained in:
2021-12-21 17:14:52 -06:00
parent e9f91126e5
commit 95697ef4fe
174 changed files with 5351 additions and 16551 deletions

View File

@@ -0,0 +1,19 @@
from django.db import models
from teamsnap.models import User as TeamsnapUser, Team as TeamsnapTeam
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
teamsnap_access_token = models.CharField(null=True, max_length=50)
teamsnap_user = models.OneToOneField(
TeamsnapUser,
on_delete=models.CASCADE,
null=True,
blank=True,
related_name="benchcoach_object"
)
avatar = models.ImageField(upload_to="avatar", null=True, blank=True)
class TeamsnapSettings(models.Model):
user = models.OneToOneField(Profile, on_delete=models.CASCADE)
managed_team = models.ForeignKey(TeamsnapTeam, on_delete=models.CASCADE)