fixed vendor import

This commit is contained in:
David Lenwell
2013-11-01 21:07:52 -07:00
parent a315aad624
commit 0d605cbedd

View File

@@ -5,10 +5,9 @@ _file = 'members_sponsors_20131030.csv'
with open(_file, 'rb') as csvfile:
parsed = csv.reader(csvfile, delimiter=',')
for row in parsed:
print ', '.join(row)
vendor = Vendor()
vendor.vendor_name = row[1]
if row[2]:
vendor.contact_email = row[2]
db.add(vendor)
db.commit()
if not row[3] == '':
vendor = Vendor()
vendor.vendor_name = row[1]
vendor.contact_email = row[3]
db.add(vendor)
db.commit()