Skip to content

Instantly share code, notes, and snippets.

@FlaviuSim
Created February 27, 2012 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlaviuSim/1927934 to your computer and use it in GitHub Desktop.
Save FlaviuSim/1927934 to your computer and use it in GitHub Desktop.
import csv
from myproject.main.models import Drug
def load_drugs(file_path):
"this loads the drugs from pipe delimited to my model"
for row in csv.reader(open(file_path), delimiter="|"):
drug = Drug(rxcui=row[0], short_name=row[1], is_brand=row[2])
drug.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment