New issue 47 by marcelos...@gmail.com: DatabaseOperations() takes 2
arguments, one found
http://code.google.com/p/django-jython/issues/detail?id=47
What steps will reproduce the problem?
1. Install django-python
2. Install django
3. Create a startup project with jython
4. Setup to work with java's postgre driver:
DATABASES = {
'default': {
'ENGINE': 'doj.backends.zxjdbc.postgresql',
'NAME': 'database',
'USER': 'username',
'PASSWORD': 'password',
'HOST': '',
'PORT': '',
}
}
5. $ jython manage.py runserver
What is the expected output? What do you see instead?
I expected to see the server running without errors, instead it got the
following:
Validating models...
Unhandled exception in thread started by <function inner_run at 0x1>
Traceback (most recent call last):
File "/home/msena/jython2.5.1/Lib/site-packages/django/core/management/commands/runserver.py",
line 48, in inner_run
self.validate(display_num_errors=True)
File "/home/msena/jython2.5.1/Lib/site-packages/django/core/management/base.py",
line 249, in validate
num_errors = get_validation_errors(s, app)
File "/home/msena/jython2.5.1/Lib/site-packages/django/core/management/validation.py",
line 22, in get_validation_errors
from django.db import models, connection
File "/home/msena/jython2.5.1/Lib/site-packages/django/db/__init__.py",
line 77, in <module>
connection = connections[DEFAULT_DB_ALIAS]
File "/home/msena/jython2.5.1/Lib/site-packages/django/db/utils.py", line
92, in __getitem__
conn = backend.DatabaseWrapper(db, alias)
File "/home/msena/jython2.5.1/Lib/site-packages/doj/backends/zxjdbc/postgresql/base.py",
line 70, in __init__
self.ops = DatabaseOperations()
TypeError: __init__() takes exactly 2 arguments (1 given)
What version of the product are you using? On what operating system?
Im running on
django-jython 1.1.1
jython2.5.1
django1.2.3
postgresql-8.4-701.jdbc3
Linux 2.6.32 i686
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Please provide any additional information below.
It seems quite obvious to me where the error is occurring:
At DatabaseWrapper's init we have:
self.ops = DatabaseOperations()
and DatabaseOperations inherits zxJDBCOperationsMixin,
PostgresqlDatabaseOperations
Since zxJDBCOperationsMixin(object) have no default constructors it is
using DatabaseOperations(BaseDatabaseOperations) constructor:
def __init__(self, connection)
However BaseDatabaseOperations does have a
def __init__(self):
self._cache = {}
strange...
This is because django-jython 1.1.1 is compatible with Django 1.1.X, not
1.2.X. We need help on making us compatible with the 1.2.X database API and
(even more importantly) test it.
Comment #2 on issue 47 by leo.soto: DatabaseOperations() takes 2 arguments,
one found
http://code.google.com/p/django-jython/issues/detail?id=47
(No comment was entered for this change.)