Skip to content

Commit

Permalink
Merge pull request #1 from hivesolutions/dev_tsilva
Browse files Browse the repository at this point in the history
Added new fields to product CSV import
  • Loading branch information
joamag committed Mar 23, 2016
2 parents 12036d6 + 2c60bf7 commit 139167b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/budy/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ def callback(line):
_brand,\
_season,\
measurements,\
compositions = line
compositions, \
price_provider, \
price_url = line

product_id = product_id or None
price = float(price) if price else None
Expand All @@ -225,6 +227,8 @@ def callback(line):
farfetch_url = farfetch_url or None
farfetch_male_url = farfetch_male_url or None
farfetch_female_url = farfetch_female_url or None
price_provider = price_provider or None
price_url = price_url or None

colors = colors.split(";") if colors else []
colors = color.Color.find(name = {"$in" : colors})
Expand Down Expand Up @@ -261,7 +265,9 @@ def callback(line):
brand = _brand,
season = _season,
measurements = measurements,
compositions = compositions
compositions = compositions,
price_provider = price_provider,
price_url = price_url
)
product.save()

Expand Down

0 comments on commit 139167b

Please sign in to comment.