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

Cannot import State of the Union dataset with Django 1.7 #69

Closed
cojoco opened this issue Aug 18, 2015 · 2 comments
Closed

Cannot import State of the Union dataset with Django 1.7 #69

cojoco opened this issue Aug 18, 2015 · 2 comments

Comments

@cojoco
Copy link

cojoco commented Aug 18, 2015

If I attempt to import the State of the Union dataset, it fails with the following traceback:

Running migrations:
  No migrations to apply.
Traceback (most recent call last):
  File "tg.py", line 452, in <module>
    main()
  File "tg.py", line 446, in main
    execute[args.which](args)
  File "tg.py", line 88, in exec_import_dataset
    database_id = import_system_utilities.run_syncdb(database_info)
  File "/local/cojoco/git/topicalguide/import_tool/import_system_utilities.py", line 98, in run_syncdb
    call_command('migrate', database=dataset_identifier)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/core/management/__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 164, in handle
    emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/core/management/sql.py", line 268, in emit_post_migrate_signal
    using=db)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 83, in create_permissions
    ctype = ContentType.objects.db_manager(using).get_for_model(klass)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 51, in get_for_model
    defaults={'name': smart_text(opts.verbose_name_raw)},
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/query.py", line 422, in get_or_create
    return self.get(**lookup), False
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/query.py", line 351, in get
    num = len(clone)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/query.py", line 122, in __len__
    self._fetch_all()
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/query.py", line 966, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/query.py", line 265, in iterator
    for row in compiler.results_iter():
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 700, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/local/cojoco/git/topicalguide/venvTestReqs/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 485, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such column: django_content_type.name
@cojoco
Copy link
Author

cojoco commented Aug 18, 2015

I have found that if I update Django (currently it updates to version 1.8.4), then the import appears to work correctly. I still need to try this on a complete clean repository (I believe the dataset was already imported in the repository I tested in, which is why I thought the error above was strange) to ensure that the dataset really does get imported correctly.

@cojoco
Copy link
Author

cojoco commented Aug 19, 2015

I cloned the repo from BYU-NLP-Lab/topicalguide/dev into a completely clean directory on my machine, and found that importing the State of the Union dataset worked if Django was updated from 1.7 to 1.8.4. This appears to be the solution to this issue, unless it breaks something else I'm not seeing. I'm going to close this for now.

@cojoco cojoco closed this as completed Aug 19, 2015
cojoco added a commit to cojoco/topicalguide that referenced this issue Aug 19, 2015
cojoco added a commit to cojoco/topicalguide that referenced this issue Aug 21, 2015
…rom BYU-NLP-Lab/topicalguide"

This reverts commit 5184d49.
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