Ticket #11428: patch.diff

File patch.diff, 3.3 KB (added by Anssi Kääriäinen, 15 years ago)
  • django/core/management/commands/dumpdata.py

     
    7373                model_list = get_models(app)
    7474
    7575            for model in model_list:
     76                if model._meta.proxy:
     77                    continue
    7678                objects.extend(model._default_manager.all())
    7779
    7880        try:
  • django/core/management/commands/syncdb.py

     
    6464                    print "Processing %s.%s model" % (app_name, model._meta.object_name)
    6565                if connection.introspection.table_name_converter(model._meta.db_table) in tables:
    6666                    continue
     67                if model._meta.proxy:
     68                    continue
    6769                sql, references = connection.creation.sql_create_model(model, self.style, seen_models)
    6870                seen_models.add(model)
    6971                created_models.add(model)
  • django/core/management/sql.py

     
    3030    pending_references = {}
    3131
    3232    for model in app_models:
     33        if model._meta.proxy:
     34            continue
    3335        output, references = connection.creation.sql_create_model(model, style, known_models)
    3436        final_output.extend(output)
    3537        for refto, refs in references.items():
     
    4244
    4345    # Create the many-to-many join tables.
    4446    for model in app_models:
     47        if model._meta.proxy:
     48            continue
    4549        final_output.extend(connection.creation.sql_for_many_to_many(model, style))
    4650
    4751    # Handle references to tables that are from other apps
     
    8488    references_to_delete = {}
    8589    app_models = models.get_models(app)
    8690    for model in app_models:
     91        if model._meta.proxy:
     92            continue
    8793        if cursor and connection.introspection.table_name_converter(model._meta.db_table) in table_names:
    8894            # The table exists, so it needs to be dropped
    8995            opts = model._meta
     
    94100            to_delete.add(model)
    95101
    96102    for model in app_models:
     103        if model._meta.proxy:
     104            continue
    97105        if connection.introspection.table_name_converter(model._meta.db_table) in table_names:
    98106            output.extend(connection.creation.sql_destroy_model(model, references_to_delete, style))
    99107
    100108    # Output DROP TABLE statements for many-to-many tables.
    101109    for model in app_models:
     110        if model._meta.proxy:
     111            continue
    102112        opts = model._meta
    103113        for f in opts.local_many_to_many:
    104114            if cursor and connection.introspection.table_name_converter(f.m2m_db_table()) in table_names:
     
    149159    from django.db import connection, models
    150160    output = []
    151161    for model in models.get_models(app):
     162        if model._meta.proxy:
     163            continue
    152164        output.extend(connection.creation.sql_indexes_for_model(model, style))
    153165    return output
    154166
Back to Top