2012-07-12 04:38:24 +00:00
|
|
|
import csv
|
|
|
|
import os
|
|
|
|
|
2014-01-13 21:49:40 +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-01-13 21:49:40 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
def handle(self, *args, **options):
|
|
|
|
csv_file = csv.writer(open(os.path.join(os.getcwd(), "speakers.csv"), "wb"))
|
|
|
|
csv_file.writerow(["Name", "Bio"])
|
2014-01-13 21:49:40 +00:00
|
|
|
|
2012-07-12 04:38:24 +00:00
|
|
|
for speaker in Speaker.objects.all():
|
|
|
|
csv_file.writerow([
|
|
|
|
speaker.name.encode("utf-8"),
|
|
|
|
speaker.biography.encode("utf-8"),
|
|
|
|
])
|