implement lineup send to gamechanger
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from django import forms
|
||||
from django.forms import ModelForm, formset_factory
|
||||
|
||||
from .models import Preferences, Account, Player
|
||||
from .models import Account, Player, Preferences
|
||||
|
||||
|
||||
class PreferencesForm(ModelForm):
|
||||
class Meta:
|
||||
@@ -13,6 +14,7 @@ class PreferencesForm(ModelForm):
|
||||
}
|
||||
labels = {"managed_team_id": "Selected Team"}
|
||||
|
||||
|
||||
class AccountForm(ModelForm):
|
||||
class Meta:
|
||||
model = Account
|
||||
@@ -20,16 +22,24 @@ class AccountForm(ModelForm):
|
||||
widgets = {
|
||||
"user": forms.HiddenInput(),
|
||||
"email": forms.EmailInput(),
|
||||
"password": forms.PasswordInput()
|
||||
"password": forms.PasswordInput(),
|
||||
}
|
||||
|
||||
|
||||
class PlayerForm(ModelForm):
|
||||
gamechanger_name = forms.Field()
|
||||
teamsnap_name = forms.Field()
|
||||
gamechanger_id = forms.Field()
|
||||
fname = forms.Field()
|
||||
lname = forms.Field()
|
||||
|
||||
class Meta:
|
||||
model = Player
|
||||
fields = ['id', 'teamsnap_member_id']
|
||||
fields = ["id", "teamsnap_member_id"]
|
||||
widgets = {
|
||||
"teamsnap_member_id": forms.Select(
|
||||
choices=(), attrs={"class": "form-control"}
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
PlayerFormSet = formset_factory(PlayerForm, can_delete=True, extra=0)
|
||||
|
||||
Reference in New Issue
Block a user