Issue 47 in django-jython: DatabaseOperations() takes 2 arguments, one found

49 views
Skip to first unread message

django...@googlecode.com

unread,
Sep 29, 2010, 8:45:33 AM9/29/10
to django-j...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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...

django...@googlecode.com

unread,
Sep 29, 2010, 11:08:57 AM9/29/10
to django-j...@googlegroups.com

Comment #1 on issue 47 by leo.soto: DatabaseOperations() takes 2 arguments,
one found
http://code.google.com/p/django-jython/issues/detail?id=47

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.

django...@googlecode.com

unread,
Sep 29, 2010, 11:21:29 AM9/29/10
to django-j...@googlegroups.com
Updates:
Status: Duplicate

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.)

django...@googlecode.com

unread,
May 30, 2012, 12:54:17 AM5/30/12
to django-j...@googlegroups.com

Comment #3 on issue 47 by admac...@gmail.com: DatabaseOperations() takes 2
I presume that this it still the case. It's not at all obvious from the
documentation that the version of Django-Jython you download should match
version numbers with Django (if this is indeed what you're saying). In fact
the docs explicitly say otherwise:

"To get started with using Django-Jython, first install it following these
steps:

Grab the latest django-jython distribution"

(http://packages.python.org/django-jython/quickstart.html#install )

it would be great if they could be updated to state that the version
numbers should match...

django...@googlecode.com

unread,
May 30, 2012, 7:57:33 AM5/30/12
to django-j...@googlegroups.com
Updates:
Status: Accepted
Owner: juneau001

Comment #4 on issue 47 by juneau001: DatabaseOperations() takes 2
I will update the documentation accordingly.

django...@googlecode.com

unread,
Oct 17, 2012, 1:45:21 PM10/17/12
to django-j...@googlegroups.com

Comment #5 on issue 47 by irishj...@gmail.com: DatabaseOperations() takes 2
Hi. I'm not sure the assessment is correct. I fixed the problem with the
attached (trivial) patch. Now it works fine. Dunno how this slipped by.





Attachments:
zxjdbc-mysql.patch 567 bytes

django...@googlecode.com

unread,
Oct 17, 2012, 1:47:52 PM10/17/12
to django-j...@googlegroups.com

Comment #6 on issue 47 by irishj...@gmail.com: DatabaseOperations() takes 2
I'm using Django 1.4.1


django...@googlecode.com

unread,
Oct 17, 2012, 1:55:59 PM10/17/12
to django-j...@googlegroups.com
Updates:
Status: Started

Comment #7 on issue 47 by juneau001: DatabaseOperations() takes 2
Thanks for the update, will ensure that this patch gets included in the
next release.

django...@googlecode.com

unread,
Aug 10, 2014, 4:08:37 AM8/10/14
to django-j...@googlegroups.com
Updates:
Status: Invalid

Comment #8 on issue 47 by andr...@st0cker.at: DatabaseOperations() takes 2
As we are supporting Django 1.7 now, this is not an issue any more. :-)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages