daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. project_home="/Users/jmoxon/Tutorial/Clothesliner/pant_entry/"
  2. csv_home="/Users/jmoxon/Tutorial/Clothesliner/pant_entry/learning.csv"
  3.  
  4. import sys, os
  5. sys.path.append(project_home)
  6. os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
  7.  
  8. from pants.models import Item
  9.  
  10. import csv
  11. dataReader = csv.reader(open(csv_home, "rU"), delimiter=',')
  12.  
  13. for row in dataReader:
  14.     item=Item()
  15.     item.brand=row[0]
  16.     item.style=row[1]
  17.     item.desc=row[2]
  18.     item.waist=row[3]
  19.     item.rise=row[4]
  20.     item.pic=row[5]
  21.     item.save()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top