Reorganized stages views in a subdirectory

This commit is contained in:
Claude Paroz 2018-06-16 18:40:34 +02:00
parent 772b0b6b01
commit f2bd9734af
9 changed files with 484 additions and 472 deletions

View file

@ -1,3 +1,6 @@
from datetime import date
def school_year(date, as_tuple=False):
"""
Return the school year of 'date'. Example:
@ -14,6 +17,15 @@ def school_year(date, as_tuple=False):
return "%d%d" % (start_year, start_year + 1)
def school_year_start():
""" Return first official day of current school year """
current_year = date.today().year
if date(current_year, 8, 1) > date.today():
return date(current_year-1, 8, 1)
else:
return date(current_year, 8, 1)
def is_int(s):
try:
int(s)