Last active
July 11, 2017 16:10
-
-
Save mcotton/c544ccb17febb5774874c76ead267613 to your computer and use it in GitHub Desktop.
Ugly way to create projects from csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('Titan-1.csv', 'rU') as csvfile: | |
filereader = csv.reader(csvfile, delimiter=',', quotechar='|') | |
for row in filereader: | |
new_p = Project(title="%s - %s" % (site.name, row[0]), | |
company=comp.key, | |
company_name=comp.name, | |
wind_farm=site.name, | |
site = site.key, | |
location="%s, %s" % (row[1], row[2]), | |
is_EOW=False, | |
is_turbine=True, | |
show_live_report=True, | |
show_links_in_live_report=True, | |
has_image=True, | |
has_checklist=False, | |
status="1_initialized") | |
new_p.put() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar problem, updating location of existing projects