mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-30 04:13:01 +00:00
Extract clubs mailing list
This commit is contained in:
parent
135cca18cc
commit
05fa27ac57
@ -6,7 +6,7 @@ from datetime import date
|
|||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from member.models import Membership
|
from member.models import Membership, Club
|
||||||
from ...models import WEIClub
|
from ...models import WEIClub
|
||||||
|
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ class Command(BaseCommand):
|
|||||||
"You can write this into a file with a pipe, then paste the document into your mail manager."
|
"You can write this into a file with a pipe, then paste the document into your mail manager."
|
||||||
|
|
||||||
def add_arguments(self, parser):
|
def add_arguments(self, parser):
|
||||||
parser.add_argument('--type', '-t', choices=["members", "events", "art", "sport"], default="members",
|
parser.add_argument('--type', '-t', choices=["members", "clubs", "events", "art", "sport"], default="members",
|
||||||
help='Select the type of the mailing list (default members)')
|
help='Select the type of the mailing list (default members)')
|
||||||
parser.add_argument('--year', '-y', type=int, default=None,
|
parser.add_argument('--year', '-y', type=int, default=None,
|
||||||
help='Select the year of the concerned WEI. Default: last year')
|
help='Select the year of the concerned WEI. Default: last year')
|
||||||
@ -31,6 +31,11 @@ class Command(BaseCommand):
|
|||||||
self.stdout.write(membership.user.email)
|
self.stdout.write(membership.user.email)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if options["type"] == "clubs":
|
||||||
|
for club in Club.objects.all():
|
||||||
|
self.stdout.write(club.email)
|
||||||
|
return
|
||||||
|
|
||||||
if options["year"] is None:
|
if options["year"] is None:
|
||||||
wei = WEIClub.objects.order_by('-year').first()
|
wei = WEIClub.objects.order_by('-year').first()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user