Django

Code

Show
Ignore:
Timestamp:
12/18/07 23:20:55 (1 year ago)
Author:
jkocherhans
Message:

newforms-admin: Merged from trunk up to [6952].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin

    • Property svnmerge-integrated changed from /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-6863 to /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-6952
  • django/branches/newforms-admin/django/utils/maxlength.py

    r6864 r6955  
    11""" 
    22Utilities for providing backwards compatibility for the maxlength argument, 
    3 which has been replaced by max_length, see ticket #2101. 
     3which has been replaced by max_length. See ticket #2101. 
    44""" 
    55 
     
    1616    Consolidates max_length and maxlength, providing backwards compatibilty 
    1717    for the legacy "maxlength" argument. 
     18 
    1819    If one of max_length or maxlength is given, then that value is returned. 
    19     If both are given, a TypeError is raised. 
    20     If maxlength is used at all, a deprecation warning is issued. 
     20    If both are given, a TypeError is raised. If maxlength is used at all, a 
     21    deprecation warning is issued. 
    2122    """ 
    2223    if maxlength is not None: 
    23         warn("maxlength is deprecated, use max_length instead.", 
    24              DeprecationWarning, 
    25              stacklevel=3) 
     24        warn("maxlength is deprecated. Use max_length instead.", DeprecationWarning, stacklevel=3) 
    2625        if max_length is not None: 
    27             raise TypeError("field can not take both the max_length" 
    28                             " argument and the legacy maxlength argument.") 
     26            raise TypeError("Field cannot take both the max_length argument and the legacy maxlength argument.") 
    2927        max_length = maxlength 
    3028    return max_length 
     
    3432    A decorator to be used on a class's __init__ that provides backwards 
    3533    compatibilty for the legacy "maxlength" keyword argument, i.e. 
    36       name = models.CharField(maxlength=20) 
     34        name = models.CharField(maxlength=20) 
     35 
    3736    It does this by changing the passed "maxlength" keyword argument 
    3837    (if it exists) into a "max_length" keyword argument. 
     
    5958    "maxlength" keyword argument. 
    6059    """ 
    61  
    6260    def __init__(cls, name, bases, attrs): 
    6361        super(LegacyMaxlength, cls).__init__(name, bases, attrs)