how to import csv data into django models

Posted by little_fish on Stack Overflow See other posts from Stack Overflow or by little_fish
Published on 2010-03-17T04:59:20Z Indexed on 2010/03/17 5:01 UTC
Read the original article Hit count: 818

Filed under:
|
|

i have some csv data and i want to export into django models the example of csv data

1;"02-01-101101";"Worm Gear HRF 50";"Ratio 1 : 10";"input shaft, output shaft, direction A, color dark green";
2;"02-01-101102";"Worm Gear HRF 50";"Ratio 1 : 20";"input shaft, output shaft, direction A, color dark green";
3;"02-01-101103";"Worm Gear HRF 50";"Ratio 1 : 30";"input shaft, output shaft, direction A, color dark green";
4;"02-01-101104";"Worm Gear HRF 50";"Ratio 1 : 40";"input shaft, output shaft, direction A, color dark green";
5;"02-01-101105";"Worm Gear HRF 50";"Ratio 1 : 50";"input shaft, output shaft, direction A, color dark green";

and i have some django models name Product in Product there is some fields like name, description and price

and i want to something like this

product=Product()

product.name = "Worm Gear HRF 70(02-01-101116)"

product.description = "input shaft, output shaft, direction A, color dark green"

product.price = 100

© Stack Overflow or respective owner

Related posts about django-models

Related posts about csv