http://docs.python.org/library/csv.html#csv.DictReader
Basically, the script would look like this:
from csv import DictReader
from product.models import Product
reader = DictReader(open('products.csv'))
for line in reader:
Product.objects.create(
#Setup the mapping between csv columns and satchmo product
attributes here
title=line['title'],
slug=line['slug_field]'
...
)
You'd probably want some error control and stuff like that, but that
is the basic idea.
Hope that helps,
Alex
> --
> You received this message because you are subscribed to the Google Groups "Satchmo users" group.
> To post to this group, send email to satchm...@googlegroups.com.
> To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
>
>
Anyway, good to hear it is working for you!
Alex
Thanks in advance.
From
Jeff
> To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For example:
load_products.py
#####
def run():
do_all_the_loading()
....
#####
Then at the terminal say:
./manage.py shell
from load_products import run
run()
That should clear up the settings issues.
Alex
What do I need to set to make these problems go away?
Thanks in advance, and thanks for this script, it's been a very
helpful starting point. :)
From
Jeff
Thanks for the ProductPriceLookup rebuild line, that does resolve that issue.
Now I have one more problem, and I could solve it myself by copying
files manually, but such a way is slow and I'd like to know what you
all think is the best way to handle this. Right now, when an image is
set, it is moved out of its directory into Satchmo's directory. I
don't want the image to be moved -- I want it to be copied. Does
anyone have a recommendation for the correct way to tell Satchmo to
copy, not move, the product's image? I could copy the file in the
script but as mentioned above, I'd like to know if there is something
simple like a parameter I can pass that will just the copy the image
from its place to Satchmo instead of moving it.
Thanks for all the help so far. :)
From
Jeff
Is there a field that makes a product not display on a category list,
but still be purchaseable, etc.? If so, I need to set it ASAP. Thanks.