37 lines
1003 B
Python
37 lines
1003 B
Python
from django import forms
|
|
from django.db import models
|
|
from django.db.models import CharField, EmailField
|
|
|
|
from benchcoach.users.models import User
|
|
|
|
|
|
# Create your models here.
|
|
class Account(models.Model):
|
|
user = models.OneToOneField(
|
|
User, on_delete=models.CASCADE, related_name="gamechanger_account"
|
|
)
|
|
email = EmailField()
|
|
password = CharField(max_length=255)
|
|
|
|
|
|
class Preferences(models.Model):
|
|
user = models.OneToOneField(
|
|
User, on_delete=models.CASCADE, related_name="gamechanger_preferences"
|
|
)
|
|
season_id = CharField(max_length=255)
|
|
team_id = CharField(max_length=255)
|
|
|
|
class Meta:
|
|
verbose_name_plural = "preferences"
|
|
|
|
|
|
class Player(models.Model):
|
|
id = models.CharField(primary_key=True, max_length=30)
|
|
teamsnap_member_id = models.IntegerField()
|
|
fname = CharField(max_length=30)
|
|
lname = CharField(max_length=30)
|
|
|
|
widgets = {
|
|
"teamsnap_member_id": forms.Select(choices=(), attrs={"class": "form-control"}),
|
|
}
|