initial multicreate plannedsesssion not working
This commit is contained in:
@@ -614,6 +614,12 @@ class BaseFavoriteFormSet(BaseFormSet):
|
||||
if not yparam2:
|
||||
yparam2 = 'None'
|
||||
|
||||
class BasePlannedSessionFormSet(BaseFormSet):
|
||||
def clean(self):
|
||||
if any(self.serrors):
|
||||
return
|
||||
|
||||
|
||||
# Check if workout is owned by this user
|
||||
def checkworkoutuser(user,workout):
|
||||
try:
|
||||
@@ -918,6 +924,35 @@ class PlannedSessionForm(ModelForm):
|
||||
'enddate': AdminDateWidget(),
|
||||
}
|
||||
|
||||
class PlannedSessionFormSmall(ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = PlannedSession
|
||||
fields = ['startdate',
|
||||
'enddate',
|
||||
'name',
|
||||
'sessiontype',
|
||||
'sessionmode',
|
||||
'criterium',
|
||||
'sessionvalue',
|
||||
'sessionunit',
|
||||
'comment',
|
||||
]
|
||||
|
||||
dateTimeOptions = {
|
||||
'format': 'yyyy-mm-dd',
|
||||
'autoclose': True,
|
||||
}
|
||||
|
||||
widgets = {
|
||||
'startdate': DateInput(attrs={'size':10}),
|
||||
'enddate': DateInput(attrs={'size':10}),
|
||||
'name': forms.TextInput(attrs={'size':10}),
|
||||
'comment': forms.TextInput(attrs={'size':10}),
|
||||
'sessionvalue': forms.TextInput(attrs={'style':'width:3em',
|
||||
'type':'number'}),
|
||||
}
|
||||
|
||||
|
||||
# Workout
|
||||
class Workout(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user