Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Normalized the name order of arguments. There's no actual bug…

… here, other than potential confusion for anyone reading the code. Thanks to Aram Dulyan for the report.

Backport of r14796 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3ad1cb7701d6f86de9b565b120da9130017ec31a 1 parent 81a85a0
Russell Keith-Magee authored December 04, 2010

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  django/db/models/fields/subclassing.py
8  django/db/models/fields/subclassing.py
@@ -63,8 +63,8 @@ class LegacyConnection(type):
63 63
     A metaclass to normalize arguments give to the get_db_prep_* and db_type
64 64
     methods on fields.
65 65
     """
66  
-    def __new__(cls, names, bases, attrs):
67  
-        new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)
  66
+    def __new__(cls, name, bases, attrs):
  67
+        new_cls = super(LegacyConnection, cls).__new__(cls, name, bases, attrs)
68 68
         for attr in ('db_type', 'get_db_prep_save'):
69 69
             setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))
70 70
         for attr in ('get_db_prep_lookup', 'get_db_prep_value'):
@@ -76,8 +76,8 @@ class SubfieldBase(LegacyConnection):
76 76
     A metaclass for custom Field subclasses. This ensures the model's attribute
77 77
     has the descriptor protocol attached to it.
78 78
     """
79  
-    def __new__(cls, base, name, attrs):
80  
-        new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)
  79
+    def __new__(cls, name, bases, attrs):
  80
+        new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
81 81
         new_class.contribute_to_class = make_contrib(
82 82
             new_class, attrs.get('contribute_to_class')
83 83
         )

0 notes on commit 3ad1cb7

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