1. Carl Meyer
  2. south

Commits

Andrew Godwin  committed ef236f0

Fix #399: Preserve field ordering in migrations.

  • Participants
  • Parent commits 82a151f
  • Branches default

Comments (0)

Files changed (1)

File south/creator/changes.py

View file
  • Ignore whitespace
 
 from django.db import models
 from django.contrib.contenttypes.generic import GenericRelation
+from django.utils.datastructures import SortedDict
 
 from south.creator.freezer import remove_useless_attributes, freeze_apps, model_key
 from south.utils import auto_through
         Given a model and its model def (a dict of field: triple), returns three
         items: the real fields dict, the Meta dict, and the M2M fields dict.
         """
-        real_fields = {}
-        meta = {}
-        m2m_fields = {}
+        real_fields = SortedDict()
+        meta = SortedDict()
+        m2m_fields = SortedDict()
         for name, triple in model_def.items():
             if name == "Meta":
                 meta = triple