metaclassco / django_oscar_flash_sale

Flash sales implementation for the Oscar.
8 stars 2 forks source link

Could not load offer.ConditionalOffer(pk=1): no such column: exclusive #2

Closed mancio1e10 closed 3 years ago

mancio1e10 commented 4 years ago

Hi. I'm trying out your project and when I ran the following command: make load_test_data

I keep getting this error: django.db.utils.OperationalError: Problem installing fixture '/Users/mjrbasoc/Downloads/django_oscar_flash_sale-master/apps/fixtures/offers.json': Could not load offer.ConditionalOffer(pk=1): no such column: exclusive

Below is the stack trace:

`(test-oscar) testusers-MBP:django_oscar_flash_sale-master test-user$ make load_test_data
# Import some fixtures. Order is important as JSON fixtures include primary keys
./manage.py loaddata apps/fixtures/auth.json
Installed 2 object(s) from 1 fixture(s)
./manage.py loaddata apps/fixtures/child_products.json
Installed 35 object(s) from 1 fixture(s)
./manage.py oscar_import_catalogue apps/fixtures/*.csv
Row number 1 has an invalid number of fields (1), skipping...
Row number 2 has an invalid number of fields (1), skipping...
Row number 3 has an invalid number of fields (1), skipping...
Row number 4 has an invalid number of fields (1), skipping...
Row number 5 has an invalid number of fields (1), skipping...
Row number 6 has an invalid number of fields (1), skipping...
./manage.py oscar_import_catalogue_images apps/fixtures/images.tar.gz
No item matching upc='9780201379266'
No item matching upc='9780471453802'
No item matching upc='9780321445612'
No item matching upc='9780262032933'
./manage.py oscar_populate_countries --initial-only
Successfully added 249 countries.
./manage.py loaddata apps/fixtures/pages.json apps/fixtures/ranges.json apps/fixtures/offers.json
Traceback (most recent call last):
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such column: exclusive

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./manage.py", line 21, in <module>
    main()
  File "./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/commands/loaddata.py", line 72, in handle
    self.loaddata(fixture_labels)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/commands/loaddata.py", line 114, in loaddata
    self.load_label(fixture_label)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/management/commands/loaddata.py", line 181, in load_label
    obj.save(using=self.using)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/core/serializers/base.py", line 223, in save
    models.Model.save_base(self.object, using=using, raw=True, **kwargs)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/base.py", line 779, in save_base
    force_update, using, update_fields,
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/base.py", line 851, in _save_table
    forced_update)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/base.py", line 900, in _do_update
    return filtered._update(values) > 0
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/query.py", line 760, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1462, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1133, in execute_sql
    cursor.execute(sql, params)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 99, in execute
    return super().execute(sql, params)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/test-user/.virtualenvs/test-oscar/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: Problem installing fixture '/Users/test-user/Downloads/django_oscar_flash_sale-master/apps/fixtures/offers.json': Could not load offer.ConditionalOffer(pk=1): no such column: exclusive
make: *** [load_test_data] Error 1`
samitnuk commented 4 years ago

Hi, @mancio1e10

Thank you for your report. Unfortunately, I cannot recreate your issue - both command (database_clean and load_test_data) work as expected for me (with Django 2.1.11 and django-oscar 2.0).

What versions of Django and django-oscar do you use?

sasha0 commented 3 years ago

Closing issue due to lack of response. Feel free to re-open in case of any further questions.