Ticket #10767: check-through-model-for-managed.diff
File check-through-model-for-managed.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/db/backends/__init__.py
497 497 if not model._meta.managed: 498 498 continue 499 499 tables.add(model._meta.db_table) 500 tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many ])500 tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many if f.rel.through is None or f.rel.through_model._meta.managed]) 501 501 if only_existing: 502 502 tables = [t for t in tables if self.table_name_converter(t) in self.table_names()] 503 503 return tables … … 530 530 break # Only one AutoField is allowed per model, so don't bother continuing. 531 531 532 532 for f in model._meta.local_many_to_many: 533 sequence_list.append({'table': f.m2m_db_table(), 'column': None}) 533 if f.rel.through is None or f.rel.through_model._meta.managed: 534 sequence_list.append({'table': f.m2m_db_table(), 'column': None}) 534 535 535 536 return sequence_list 536 537