reformatted lineup into a table
This commit is contained in:
@@ -2,16 +2,17 @@ from django import forms
|
||||
from .models import Positioning
|
||||
from events.models import Event
|
||||
from players.models import Player
|
||||
from django.forms import modelformset_factory, inlineformset_factory, NumberInput
|
||||
from django.forms import modelformset_factory, inlineformset_factory, BaseModelFormSet
|
||||
from crispy_forms.helper import FormHelper, Layout
|
||||
|
||||
class PositioningForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Positioning
|
||||
widgets = {
|
||||
'order': forms.NumberInput(attrs={'class':'input-group-text w-25'}),
|
||||
'player': forms.Select(attrs={'class': 'form-control'}),
|
||||
'position': forms.Select(attrs={'class': 'input-group-text w-25'})
|
||||
'order': forms.NumberInput(attrs={'class':'w-100'}),
|
||||
# 'player': forms.Select(attrs={'class': 'form-control'}),
|
||||
'position': forms.Select(attrs={'class': 'w-100'}),
|
||||
'ordering': forms.NumberInput(attrs={'class':'w-100'})
|
||||
}
|
||||
exclude = ()
|
||||
|
||||
@@ -19,7 +20,8 @@ PositioningFormSet = modelformset_factory(
|
||||
model=Positioning,
|
||||
form=PositioningForm,
|
||||
fields = ['player', 'position', 'order'],
|
||||
min_num=9
|
||||
min_num=9,
|
||||
can_order=True
|
||||
)
|
||||
|
||||
# class PositioningFormSet(modelformset_factory):
|
||||
|
||||
Reference in New Issue
Block a user