Source code for registration.management.commands.export_registrations

from django.core.management.base import BaseCommand, CommandError

from registration.models import export_registrations

[docs]class Command(BaseCommand): help = 'Export a csv file of the registered participants.'
[docs] def add_arguments(self, parser): parser.add_argument('file', nargs=1, type=str)
[docs] def handle(self, *args, **options): f = open(options['file'][0], 'w', newline='') export_registrations(f)