summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-12-04 07:05:22 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-12-04 07:05:22 +0000
commit3ad1cb7701d6f86de9b565b120da9130017ec31a (patch)
treea1852ac00b9d594dbfd965bd7072d3d3f356b6a0
parent81a85a0c2b6741b82819687db6a5bc092d7c4508 (diff)
[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
-rw-r--r--django/db/models/fields/subclassing.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py
index e7cf48349f..8647cb3c02 100644
--- a/django/db/models/fields/subclassing.py
+++ b/django/db/models/fields/subclassing.py
@@ -63,8 +63,8 @@ class LegacyConnection(type):
A metaclass to normalize arguments give to the get_db_prep_* and db_type
methods on fields.
"""
- def __new__(cls, names, bases, attrs):
- new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)
+ def __new__(cls, name, bases, attrs):
+ new_cls = super(LegacyConnection, cls).__new__(cls, name, bases, attrs)
for attr in ('db_type', 'get_db_prep_save'):
setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))
for attr in ('get_db_prep_lookup', 'get_db_prep_value'):
@@ -76,8 +76,8 @@ class SubfieldBase(LegacyConnection):
A metaclass for custom Field subclasses. This ensures the model's attribute
has the descriptor protocol attached to it.
"""
- def __new__(cls, base, name, attrs):
- new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)
+ def __new__(cls, name, bases, attrs):
+ new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
new_class.contribute_to_class = make_contrib(
new_class, attrs.get('contribute_to_class')
)