Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed dict randomization issue in inspectdb

  • Loading branch information...
commit b757e7ae183e30e52e809d7f347f15285dd3d9fd 1 parent 7bbd17b
Claude Paroz authored January 31, 2013
5  django/core/management/commands/inspectdb.py
@@ -6,6 +6,7 @@
6 6
 
7 7
 from django.core.management.base import NoArgsCommand, CommandError
8 8
 from django.db import connections, DEFAULT_DB_ALIAS
  9
+from django.utils.datastructures import SortedDict
9 10
 
10 11
 
11 12
 class Command(NoArgsCommand):
@@ -67,7 +68,7 @@ def handle_inspection(self, options):
67 68
             used_column_names = [] # Holds column names used in the table so far
68 69
             for i, row in enumerate(connection.introspection.get_table_description(cursor, table_name)):
69 70
                 comment_notes = [] # Holds Field notes, to be displayed in a Python comment.
70  
-                extra_params = {}  # Holds Field parameters such as 'db_column'.
  71
+                extra_params = SortedDict()  # Holds Field parameters such as 'db_column'.
71 72
                 column_name = row[0]
72 73
                 is_relation = i in relations
73 74
 
@@ -191,7 +192,7 @@ def get_field_type(self, connection, table_name, row):
191 192
         description, this routine will return the given field type name, as
192 193
         well as any additional keyword parameters and notes for the field.
193 194
         """
194  
-        field_params = {}
  195
+        field_params = SortedDict()
195 196
         field_notes = []
196 197
 
197 198
         try:

0 notes on commit b757e7a

Please sign in to comment.
Something went wrong with that request. Please try again.