Package: python-django-extensions
Version: 0.6+git201107051902-1
Severity: serious

Hello,

it looks like sqldiff in django_extensions has bitrotten considerably:

$ ./manage.py sqldiff 
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
232, in execute
    output = self.handle(*args, **options)
  File 
"/usr/lib/pymodules/python2.7/django_extensions/management/commands/sqldiff.py",
 line 583, in handle
    if settings.DATABASE_ENGINE == 'dummy':
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 185, 
in inner
    return func(self._wrapped, *args)
AttributeError: 'Settings' object has no attribute 'DATABASE_ENGINE'

See: https://docs.djangoproject.com/en/1.2/ref/settings/#deprecated-settings

I replaced DATABASE_ENGINE with DATABASES["default"]["ENGINE"], and now I hit:
http://stackoverflow.com/questions/7042463/django-postgres-transaction-managed-block-ended-with-pending-commit-rollback

I commented out transaction usage and now I get this:

$ ./manage.py sqldiff services
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 
232, in execute
    output = self.handle(*args, **options)
  File 
"/usr/lib/pymodules/python2.7/django_extensions/management/commands/sqldiff.py",
 line 612, in handle
    sqldiff_instance.find_differences()
  File 
"/usr/lib/pymodules/python2.7/django_extensions/management/commands/sqldiff.py",
 line 359, in find_differences
    self.find_field_type_differ(meta, table_description, table_name)
  File 
"/usr/lib/pymodules/python2.7/django_extensions/management/commands/sqldiff.py",
 line 279, in find_field_type_differ
    model_type = self.strip_parameters(self.get_field_model_type(field))
  File 
"/usr/lib/pymodules/python2.7/django_extensions/management/commands/sqldiff.py",
 line 164, in get_field_model_type
    return field.db_type()
TypeError: db_type() takes exactly 2 arguments (1 given)

Finally, I passed django.db.connection to all db_type calls in sqldiff.py, and
the command works, limited to the 'default' database.

I copied 
https://raw.github.com/django-extensions/django-extensions/master/django_extensions/management/commands/sqldiff.py
to /usr/share/pyshared/django_extensions/management/commands/sqldiff.py and it
also worked, so a saner fix could probably be to just fetch the new sqldiff.py
from upstream.


Ciao,

Enrico


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-django-extensions depends on:
ii  python          2.7.3~rc2-1
ii  python-django   1.4.1-2
ii  python-support  1.0.15

Versions of packages python-django-extensions recommends:
ii  libjs-jquery  1.7.2+debian-2.1

Versions of packages python-django-extensions suggests:
ii  python [python-profiler]  2.7.3~rc2-1
pn  python-boto               <none>
pn  python-keyczar            <none>
ii  python-pygraphviz         1.1-2
ii  python-werkzeug           0.8.3+dfsg-1

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to