home / django_tickets / tickets

tickets: 8331

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
8331 2008-08-15 03:05:46 2008-08-15 07:41:36 2022-03-06 03:41:58.224901 Unreviewed closed Core (Management commands)     dev fixed manage.py sqlclear and friends crash, for unknown reasons When I run manage.py sqlclear, it often crashes with the following traceback: {{{ $ ./manage.py sqlclear tests Traceback (most recent call last): File "./manage.py", line 11, in <module> execute_manager(settings) File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 334, in execute_manager utility.execute() File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 295, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 77, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 96, in execute output = self.handle(*args, **options) File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 146, in handle app_output = self.handle_app(app, **options) File "/Library/Python/2.5/site-packages/django/core/management/commands/sqlclear.py", line 10, in handle_app return u'\n'.join(sql_delete(app, self.style)).encode('utf-8') File "/Library/Python/2.5/site-packages/django/core/management/sql.py", line 98, in sql_delete output.extend(connection.creation.sql_destroy_model(model, references_to_delete, style)) File "/Library/Python/2.5/site-packages/django/db/backends/creation.py", line 263, in sql_destroy_model output.extend(self.sql_remove_table_constraints(model, references_to_delete, style)) TypeError: sql_remove_table_constraints() takes exactly 3 arguments (4 given) }}} As far as I can tell, though, sql_remove_table_constraints() does actually want four arguments (including self). An example for which this happens is a simple project, with only the one app installed, whose models.py looks like {{{ from django.db import models class Watcher(models.Model): user = models.ForeignKey('User') class User(models.Model): pass }}} If you switch the order of the definitions, however, it works fine (outputting the appropriate DROP statements). nobody d00gs   0 0 0 0 0 0
Powered by Datasette · Queries took 1.178ms