Django

Code

Changeset 6921

Show
Ignore:
Timestamp:
12/17/07 00:02:35 (1 year ago)
Author:
mtredinnick
Message:

Generic relations should not try to drop their related table in "sqlreset".

Fixed #3480.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/sql.py

    r6650 r6921  
    117117    from django.db import connection, models, get_introspection_module 
    118118    from django.db.backends.util import truncate_name 
     119    from django.contrib.contenttypes import generic 
    119120    introspection = get_introspection_module() 
    120121 
     
    180181        opts = model._meta 
    181182        for f in opts.many_to_many: 
     183            if isinstance(f.rel, generic.GenericRel): 
     184                continue 
    182185            if cursor and table_name_converter(f.m2m_db_table()) in table_names: 
    183186                output.append("%s %s;" % (style.SQL_KEYWORD('DROP TABLE'),