Opened 9 years ago

Closed 9 years ago

#12058 closed (fixed)

resetting an app ( 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: UI/UX:


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

Traceback (most recent call last):

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


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


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


File "/usr/local/lib/python2.6/dist-packages/django/core/management/", line 195, in run_from_argv

self.execute(*args, options.dict)

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

output = self.handle(*args, options)

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

app_output = self.handle_app(app, options)

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

sql_list = sql_reset(app,, connection)

File "/usr/local/lib/python2.6/dist-packages/django/core/management/", 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/", 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 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Lemuel Formacil

comment:1 Changed 9 years ago by Russell Keith-Magee

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