Ticket #53: django-admin-sqlclear.patch

File django-admin-sqlclear.patch, 748 bytes (added by Dobbes, 10 years ago)

Patch to fix the sqlclear bug

  • django-admin.py

     
    131131            else:
    132132                output.append("DROP TABLE %s_%s;" % (opts.db_table, f.name))
    133133    output.append("DELETE FROM packages WHERE label = '%s';" % mod._MODELS[0]._meta.app_label)
     134    output.append("DELETE FROM auth_permissions WHERE package = '%s';" % mod._MODELS[0]._meta.app_label)
    134135    output.append("DELETE from content_types WHERE package = '%s';" % mod._MODELS[0]._meta.app_label)
    135136    return output[::-1] # Reverse it, to deal with table dependencies.
    136137get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given app(s)."
Back to Top