Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product_db command issue: Possible duplication due to variation using ProductVariation.objects.create #294

Open
sathishantonlinuxs opened this issue May 20, 2016 · 0 comments

Comments

@sathishantonlinuxs
Copy link

Product_db command issue: Possible duplication due to just "objects.create" rather than "objects.get_or_create":

variation = ProductVariation.objects.create(
# strip whitespace
sku=row[SKU].replace(" ", ""),
product=product,
)

Where as all other commands use:
product, created = Product.objects.get_or_create(title=row[TITLE])
base_cat, created = Category.objects.get_or_create(title=row[CATEGORY])
sub_cat, created = Category.objects.get_or_create(
shop_cat, created = Category.objects.get_or_create(title="Shop")
image, created = ProductImage.objects.get_or_create(
new_option, created = ProductOption.objects.get_or_create(

Changing variation to objects.get_or_create causes some other indexing errors.

Any Special reason why variation alone uses "objects.create" whereas the others use "objects.get_or_create".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant