Ticket #11428: patch.diff
File patch.diff, 3.3 KB (added by , 15 years ago) |
---|
-
django/core/management/commands/dumpdata.py
73 73 model_list = get_models(app) 74 74 75 75 for model in model_list: 76 if model._meta.proxy: 77 continue 76 78 objects.extend(model._default_manager.all()) 77 79 78 80 try: -
django/core/management/commands/syncdb.py
64 64 print "Processing %s.%s model" % (app_name, model._meta.object_name) 65 65 if connection.introspection.table_name_converter(model._meta.db_table) in tables: 66 66 continue 67 if model._meta.proxy: 68 continue 67 69 sql, references = connection.creation.sql_create_model(model, self.style, seen_models) 68 70 seen_models.add(model) 69 71 created_models.add(model) -
django/core/management/sql.py
30 30 pending_references = {} 31 31 32 32 for model in app_models: 33 if model._meta.proxy: 34 continue 33 35 output, references = connection.creation.sql_create_model(model, style, known_models) 34 36 final_output.extend(output) 35 37 for refto, refs in references.items(): … … 42 44 43 45 # Create the many-to-many join tables. 44 46 for model in app_models: 47 if model._meta.proxy: 48 continue 45 49 final_output.extend(connection.creation.sql_for_many_to_many(model, style)) 46 50 47 51 # Handle references to tables that are from other apps … … 84 88 references_to_delete = {} 85 89 app_models = models.get_models(app) 86 90 for model in app_models: 91 if model._meta.proxy: 92 continue 87 93 if cursor and connection.introspection.table_name_converter(model._meta.db_table) in table_names: 88 94 # The table exists, so it needs to be dropped 89 95 opts = model._meta … … 94 100 to_delete.add(model) 95 101 96 102 for model in app_models: 103 if model._meta.proxy: 104 continue 97 105 if connection.introspection.table_name_converter(model._meta.db_table) in table_names: 98 106 output.extend(connection.creation.sql_destroy_model(model, references_to_delete, style)) 99 107 100 108 # Output DROP TABLE statements for many-to-many tables. 101 109 for model in app_models: 110 if model._meta.proxy: 111 continue 102 112 opts = model._meta 103 113 for f in opts.local_many_to_many: 104 114 if cursor and connection.introspection.table_name_converter(f.m2m_db_table()) in table_names: … … 149 159 from django.db import connection, models 150 160 output = [] 151 161 for model in models.get_models(app): 162 if model._meta.proxy: 163 continue 152 164 output.extend(connection.creation.sql_indexes_for_model(model, style)) 153 165 return output 154 166