-
Notifications
You must be signed in to change notification settings - Fork 103
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
django-admin inspectdb #99
Comments
I am getting very similar error when just trying to do a runserver: File "/usr/lib/python2.7/site-packages/django/utils/autoreload.py", line 225, in wrapper |
Can you guys post SSCCEs, specify the versions of all your packages with |
|
Python 2.7.5, Microsoft SQL server 2012 ansible==1.7.1 I looked a bit into the introspection.py as well, get_table_list needs to return a list of TableInfo(), it does require an adjustment to the SQL Queries to get the TABLE_INFO to include with the TableInfo(). Then a SchemaEditor also needs to be included: https://docs.djangoproject.com/en/1.8/ref/schema-editor/ |
Same issue with broke in the same place as above |
I am having the same issue with manage.py run server. I created a new project with nothing in it and no other changes to make sure it wasn't something else causing the issue. Platform: Mac OS X 10.11.5 installed via macports: pip freeze output:
DB Server: Microsoft SQL Server 2012 changes to settings.py: DATABASES = {
'default': {
'ENGINE': "django_pyodbc",
'HOST': "myhostname,1433",
'USER': "myusername",
'PASSWORD': "mypassword",
'NAME': "mydbname",
'OPTIONS': {
'host_is_server': True,
},
}
} Connections have been checked successfully with tsql and isql. Stack trace: Unhandled exception in thread started by <function wrapper at 0x108608d70>
Traceback (most recent call last):
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 116, in inner_run
self.check_migrations()
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 168, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/backends/base/introspection.py", line 58, in table_names
return get_names(cursor)
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/backends/base/introspection.py", line 53, in get_names
return sorted(ti.name for ti in self.get_table_list(cursor)
File "/Users/aron/DEV/VENVS/higgins-venv/lib/python2.7/site-packages/django/db/backends/base/introspection.py", line 54, in <genexpr>
if include_views or ti.type == 't')
AttributeError: 'unicode' object has no attribute 'type' |
Not sure if this is realy implemeted and tested. Got the following exception:
A short look into django/db/backends/base/introspection.py pointed out that get_table_list()
should return a list of objects with attributes like name and type, but django-pyodbc's get_table_list() returns a list of table name unicodes.
The text was updated successfully, but these errors were encountered: