Created
February 27, 2012 23:39
-
-
Save FlaviuSim/1927934 to your computer and use it in GitHub Desktop.
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 | |
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