make sqldiff work with django 1.3 #90

Merged
merged 4 commits into from Oct 9, 2011

Projects

None yet

5 participants

@bit

No description provided.

@funkybob

Confirming this patch worked for me.

@MichaelBlume

Thanks, works great for me

@rubic

I'm getting the following traceback when running sqldiff (current 7 pre repo) with django 1.3.

/usr/local/lib/python2.6/dist-packages/django_extensions/management/commands/sqldiff.py:164: DeprecationWarning: inner has been called without providing a connection argument.
return field.db_type()
/usr/local/lib/python2.6/dist-packages/django_extensions/management/commands/sqldiff.py:213: DeprecationWarning: inner has been called without providing a connection argument.
field_db_type = getattr(models, reverse_type)(*kwargs).db_type()
/usr/local/lib/python2.6/dist-packages/django_extensions/management/commands/sqldiff.py:270: DeprecationWarning: inner has been called without providing a connection argument.
self.add_difference('field-missing-in-db', table_name, field_name, field.db_type())
Traceback (most recent call last):
File "manage.py", line 11, in
execute_manager(settings)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 379, 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 191, in run_from_argv
self.execute(
args, *options.dict)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 220, in execute
output = self.handle(
args, **options)
File "/usr/local/lib/python2.6/dist-packages/django_extensions/management/commands/sqldiff.py", line 612, in handle
sqldiff_instance.find_differences()
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py", line 222, in inner
self.exit(None, None, None)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py", line 207, in exit
self.exiting(exc_value, self.using)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py", line 302, in exiting
leave_transaction_management(using=using)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py", line 56, in leave_transaction_management
connection.leave_transaction_management()
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/init.py", line 115, in leave_transaction_management
raise TransactionManagementError("Transaction managed block ended with "
django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK

@rubic

There are at least 2 serious errors in sqldiff.py:

line 337:
model_diffs.append((app_model.name, [str(e).strip()]))
'model_diffs' is undefined

line 387:
print style.NOTICE("App"), style.SQL_TABLE(app_name), style.NOTICE('Model'), style.SQL_TABLE(model_name), text
'app_name' is undefined

@trbs trbs merged commit fd3d4a5 into django-extensions:master Oct 9, 2011
@trbs
Django Extensions member

rubic your right, i fixed the one on line 387, busy with the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment