Skip to content

Instantly share code, notes, and snippets.

@FlaviuSim
Created February 29, 2012 13:43
Show Gist options
  • Save FlaviuSim/1940933 to your computer and use it in GitHub Desktop.
Save FlaviuSim/1940933 to your computer and use it in GitHub Desktop.
def load_drugs3(file_path):
"this loads drugs from pipe delimited file with headers"
reader = csv.DictReader(file_path)
for row in reader:
drug = Drug(rxcui=row['Rxcui'], short_name=row['Short Name'], is_brand
= row['Is Brand'])
drug.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment