Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2020-06-21 18:16:35 +02:00
parent 14bc64b3db
commit a128bdd530

View File

@@ -1379,16 +1379,25 @@ def default_class(r,w,race):
if standards.count()==0: if standards.count()==0:
# omit weight # omit weight
standards = CourseStandard.objects.filter(agemin__lt=age,agemax__gt=age, standards = CourseStandard.objects.filter(
boatclass=boatclass, agemin__lt=age,agemax__gt=age,
adaptiveclass=adaptiveclass, boatclass=boatclass,
boattype=boattype, adaptiveclass=adaptiveclass,
).order_by("agemax","-agemin","boattype","sex") boattype=boattype,
).order_by(
"agemax","-agemin","boattype","sex","weightcategory"
)
if standards.count()==0: if standards.count()==0:
standards = CourseStandard.objects.filter(agemin__lt=age,agemax__gt=age, standards = CourseStandard.objects.filter(
boattype=boattype).order_by("agemax","-agemin","boattype","sex") agemin__lt=age,agemax__gt=age,
boattype=boattype
).order_by(
"agemax","-agemin","boattype","sex")
if standards.count()==0: if standards.count()==0:
standards = CourseStandard.objects.filter(agemin__lt=age,agemax__gt=age).order_by("agemax","-agemin","boattype","sex") standards = CourseStandard.objects.filter(
agemin__lt=age,agemax__gt=age
).order_by(
"agemax","-agemin","boattype","sex")
if standards.count()==0: if standards.count()==0:
# boolean, boattype, boatclass, adaptiveclass, weightclass, sex, coursestandard, # boolean, boattype, boatclass, adaptiveclass, weightclass, sex, coursestandard,