2012-07-12 04:38:24 +00:00
|
|
|
import csv
|
|
|
|
import os
|
|
|
|
|
2014-07-30 18:19:26 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
2012-07-12 04:38:24 +00:00
|
|
|
|
|
|
|
from symposion.speakers.models import Speaker
|
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
def handle(self, *args, **options):
|
2017-04-17 12:51:48 +00:00
|
|
|
with open(os.path.join(os.getcwd(), "speakers.csv"), "w") as csv_file:
|
|
|
|
csv_writer = csv.writer(csv_file)
|
|
|
|
csv_writer.writerow(["Name", "Bio"])
|
2014-07-30 18:19:26 +00:00
|
|
|
|
2017-04-17 12:51:48 +00:00
|
|
|
for speaker in Speaker.objects.all():
|
|
|
|
csv_writer.writerow([
|
|
|
|
speaker.name,
|
|
|
|
speaker.biography,
|
|
|
|
])
|