Opened 15 years ago

Closed 14 years ago

#12058 closed (fixed)

resetting an app (manage.py reset) with a --database option results in an AttributeError: 'str' object has no attribute 'introspection'

Reported by: Lemuel Formacil Owned by: nobody
Component: Core (Management commands) Version: soc2009/multidb
Severity: Keywords: multidb
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

when doing a manage.py reset of an app with a --database option results in

Traceback (most recent call last):

File "./manage.py", line 11, in <module>

execute_manager(settings)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 439, in execute_manager

utility.execute()

File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 380, 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 195, in run_from_argv

self.execute(*args, options.dict)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 222, in execute

output = self.handle(*args, options)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 286, in handle

app_output = self.handle_app(app, options)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/commands/reset.py", line 33, in handle_app

sql_list = sql_reset(app, self.style, connection)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/sql.py", line 119, in sql_reset

return sql_delete(app, style, connection) + sql_all(app, style, connection)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/sql.py", line 99, in sql_delete

if connection.introspection.table_name_converter(model._meta.db_table) in table_names:

AttributeError: 'str' object has no attribute 'introspection'

this is because the "dbs" variable expects a list of connection instances but when given a --database option it is set with a list of the database name instead.

Attachments (1)

reset-with-database-option.diff (523 bytes ) - added by Lemuel Formacil 15 years ago.

Download all attachments as: .zip

Change History (2)

by Lemuel Formacil, 15 years ago

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

Fixed inadvertently by a change to the way reset interacts with multiple databases.

Note: See TracTickets for help on using tickets.
Back to Top