google-code-export / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Runserver fails with rev 173 #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install trunk version of django-pyodbc
2. create django project that uses sql server
3. python manage runserver

What is the expected output? What do you see instead?
Typical development webserver 

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File
"/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
line
439, in execute_manager
    utility.execute()
  File
"/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
line
380, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File
"/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
line 213, in execute
    translation.activate('en-us')
  File
"/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py",
line 73, in activate
    return real_activate(language)
  File
"/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py",
line 43, in delayed_loader
    return g['real_%s' % caller](*args, **kwargs)
  File
"/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py",
line 209, in activate
    _active[currentThread()] = translation(language)
  File
"/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py",
line 198, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File
"/usr/local/lib/python2.6/dist-packages/django/utils/translation/trans_real.py",
line 184, in _fetch
    app = import_module(appname)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py",
line 35, in import_module
    __import__(name)
  File
"/usr/local/lib/python2.6/dist-packages/django/contrib/admin/__init__.py",
line 1, in <module>
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
  File
"/usr/local/lib/python2.6/dist-packages/django/contrib/admin/helpers.py",
line 1, in <module>
    from django import forms
  File "/usr/local/lib/python2.6/dist-packages/django/forms/__init__.py",
line 17, in <module>
    from models import *
  File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py",
line 6, in <module>
    from django.db import connections
  File "/usr/local/lib/python2.6/dist-packages/django/db/__init__.py", line
74, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/usr/local/lib/python2.6/dist-packages/django/db/utils.py", line
76, in __getitem__
    conn = backend.DatabaseWrapper(db, alias)
  File "/usr/local/lib/python2.6/dist-packages/sql_server/pyodbc/base.py",
line 114, in __init__
    self.validation = BaseDatabaseValidation()
TypeError: __init__() takes exactly 2 arguments (1 given)

What version of the product are you using? On what operating system?
django-pyodbc rev 173, django trunk

Original issue reported on code.google.com by garcia.daniel.ee on 5 Jan 2010 at 10:33

Attachments:

GoogleCodeExporter commented 9 years ago
I am having the same issue. I updated from a month old version of django to 
revision 
12205 and I get the same error.

Original comment by ross.peo...@gmail.com on 11 Jan 2010 at 6:06

GoogleCodeExporter commented 9 years ago
Hopefully this helps, but I just looked at Django's new MySQL backend base.py 
file and  
it calls self.validation = DatabaseValidation(self).....notice the 'self' 
argument which is 
not in django-pyodbc revision 173

I added this to my django-pyodbc base.py file and it seems to work 
properly....so until a 
new revision is released, it seems as though this problem is very easy to 
fix...open the 
base.py file for django-pyodbc and go to line 114, then add 'self' as the 
single argument 
to BaseDatabaseValidation()

Original comment by ross.peo...@gmail.com on 11 Jan 2010 at 6:17

GoogleCodeExporter commented 9 years ago
I also had to add this line to operations.py, DatabaseOperations because 
BaseDatabaseOperations now has an __init__() function:

super(DatabaseOperations, self).__init__()

Original comment by ross.peo...@gmail.com on 11 Jan 2010 at 6:34

GoogleCodeExporter commented 9 years ago
I'm still having problems with this. Now it's giving me a KeyError at 
settings_dict['DATABASE_OPTIONS'] in base.py, line 121. This really needs to be 
fixed as 
soon as possible, as I am not able to continue developing my project. Priority 
should be 
changed to critical.

Original comment by ross.peo...@gmail.com on 11 Jan 2010 at 6:38

GoogleCodeExporter commented 9 years ago
Fixed at revision 174.

Original comment by vcc.ch...@gmail.com on 12 Jan 2010 at 6:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
@jordanthecoder, Make sure you update Django AND Django-Pyodbc. Once revision 
174 was released, my problems went away.

Original comment by ross.peo...@gmail.com on 26 Jan 2010 at 12:11