standards can be downloaded and deactivated
This commit is contained in:
@@ -2187,6 +2187,7 @@ class StandardCollection(models.Model):
|
||||
name = models.CharField(max_length=150)
|
||||
manager = models.ForeignKey(User, null=True,on_delete=models.CASCADE)
|
||||
notes = models.CharField(blank=True,null=True,max_length=1000)
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -2207,9 +2208,10 @@ class CourseStandard(models.Model):
|
||||
standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('name','sex','agemin',
|
||||
'agemax','boatclass','boattype','weightclass','adaptiveclass',
|
||||
'skillclass','standardcollection')
|
||||
unique_together = (
|
||||
('name','standardcollection')
|
||||
)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -2456,6 +2458,7 @@ class IndoorVirtualRaceForm(ModelForm):
|
||||
self.fields['sessionunit'].initial = 'm'
|
||||
if timezone:
|
||||
self.fields['timezone'].initial = timezone
|
||||
self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True)
|
||||
|
||||
def clean(self):
|
||||
cd = self.cleaned_data
|
||||
@@ -2583,6 +2586,7 @@ class VirtualRaceForm(ModelForm):
|
||||
def __init__(self,*args,**kwargs):
|
||||
super(VirtualRaceForm, self).__init__(*args, **kwargs)
|
||||
self.fields['course'].queryset = GeoCourse.objects.all().order_by("country","name")
|
||||
self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True)
|
||||
|
||||
|
||||
def clean(self):
|
||||
|
||||
Reference in New Issue
Block a user