소스 검색

Fix test breakage from previous state fix

Andrew Godwin 10 년 전
부모
커밋
386166970c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      django/db/migrations/state.py

+ 6 - 0
django/db/migrations/state.py

@@ -204,6 +204,12 @@ class ModelState(object):
                     options[name] = set(normalize_together(it))
                 else:
                     options[name] = model._meta.original_attrs[name]
+        # If we're ignoring relationships, remove all field-listing model
+        # options (that option basically just means "make a stub model")
+        if exclude_rels:
+            for key in ["unique_together", "index_together", "order_with_respect_to"]:
+                if key in options:
+                    del options[key]
 
         def flatten_bases(model):
             bases = []