From 890fa996af2fa4f7df778e173864bedec7db9b91 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 8 Aug 2020 23:48:22 +0000 Subject: [PATCH] Add script to export member addresses --- apiserver/export_member_addresses.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 apiserver/export_member_addresses.py diff --git a/apiserver/export_member_addresses.py b/apiserver/export_member_addresses.py new file mode 100755 index 0000000..cae8d77 --- /dev/null +++ b/apiserver/export_member_addresses.py @@ -0,0 +1,13 @@ +import django, sys, os +os.environ['DJANGO_SETTINGS_MODULE'] = 'apiserver.settings' +django.setup() + +import csv +from apiserver.api import models + +members = models.Member.objects.all() + +writer = csv.writer(sys.stdout) + +for m in members: + writer.writerow([m.id, m.first_name, m.last_name, m.street_address, m.city, m.postal_code])