Files @ 34c7beec35bb
Branch filter:

Location: symposion_app/vendor/symposion/speakers/management/commands/export_speaker_data.py - annotation

James Polley
Update initial fixtures for LCA2019
import csv
import os

from django.core.management.base import BaseCommand

from symposion.speakers.models import Speaker


class Command(BaseCommand):

    def handle(self, *args, **options):
        with open(os.path.join(os.getcwd(), "speakers.csv"), "w") as csv_file:
            csv_writer = csv.writer(csv_file)
            csv_writer.writerow(["Name", "Bio"])

            for speaker in Speaker.objects.all():
                csv_writer.writerow([
                    speaker.name,
                    speaker.biography,
                ])