|
|
|
|
@ -7,11 +7,11 @@ from .models import WEEKDAYS
|
|
|
|
|
|
|
|
|
|
def generate_group_overview(all_groups, limit_to_public = True):
|
|
|
|
|
"""
|
|
|
|
|
Creates an Excel Sheet with an overview of all the groups, their dates, times, age range and
|
|
|
|
|
Creates an Excel Sheet with an overview of all the groups, their dates, times, age range and
|
|
|
|
|
number of members, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arguments:
|
|
|
|
|
limit_to_public (optional, default is True): If False, all groups are returned in the overview,
|
|
|
|
|
limit_to_public (optional, default is True): If False, all groups are returned in the overview,
|
|
|
|
|
including technical ones. If True, only groups with the flag "show_on_website" are returned.
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
@ -23,7 +23,7 @@ def generate_group_overview(all_groups, limit_to_public = True):
|
|
|
|
|
title = workbook.add_format({'bold': True, 'font_size': 16, 'align': 'center'})
|
|
|
|
|
right = workbook.add_format({'bold': True, 'align': 'right'})
|
|
|
|
|
worksheet = workbook.add_worksheet()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worksheet.merge_range(0, 0, 0, 6, f"Gruppenübersicht JDAV {settings.SEKTION}", title)
|
|
|
|
|
row = 1
|
|
|
|
|
worksheet.write(row, 0, "Gruppe", bold)
|
|
|
|
|
@ -46,7 +46,7 @@ def generate_group_overview(all_groups, limit_to_public = True):
|
|
|
|
|
tn_count = group.member_set.count() - yl_count
|
|
|
|
|
members = f"JG {group.year_from} - {group.year_to}"
|
|
|
|
|
leaders = f"{', '.join([yl.name for yl in group.leiters.all()])}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worksheet.write(row, 0, group.name, default)
|
|
|
|
|
worksheet.write(row, 1, wd, default)
|
|
|
|
|
worksheet.write(row, 2, times, default)
|
|
|
|
|
@ -54,7 +54,7 @@ def generate_group_overview(all_groups, limit_to_public = True):
|
|
|
|
|
worksheet.write(row, 4, tn_count, default)
|
|
|
|
|
worksheet.write(row, 5, yl_count, default)
|
|
|
|
|
worksheet.write(row, 6, leaders, default)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worksheet.write(row+2, 6, f"Stand: {today}", right)
|
|
|
|
|
# set column width
|
|
|
|
|
worksheet.set_column_pixels(0, 0, 100)
|
|
|
|
|
|