WebFaction
Community site: login faq

ive built a mini shop as part of a project. im trying to drag content in from csv, using one of the django snippets link:(http://djangosnippets.org/snippets/788/)

so my models are Brand Category Product and product references both a brand and a category.

python csvimport.py --csv dubkorps.csv --mappings "1=partno,2=brand1(Brand|id),3=category1(Category|id),4=pr......

snipped for brevity, but that is the format of the import statement. however the foreign key doesnt work, it fails with

django.db.utils.IntegrityError: shop_product.brand1_id may not be NULL

it fails with this same error whether i put brand.name or brand.id into the csv file.

anyone used this csvimport successfully?

asked 04 Nov '10, 10:45

Shofty
112
accept rate: 0%

edited 04 Nov '10, 10:45

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×337

question asked: 04 Nov '10, 10:45

question was seen: 4,807 times

last updated: 04 Nov '10, 10:45

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM