Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5342 -- Added max_length parameter to EmailField. Thanks, dons…

…paulding and gwilson

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6205 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0d52d2b2f90ea12c2ca721a46052b0c17bae3b47 1 parent fe78237
Adrian Holovaty authored September 14, 2007
3  django/db/models/fields/__init__.py
@@ -686,7 +686,8 @@ def formfield(self, **kwargs):
686 686
 
687 687
 class EmailField(CharField):
688 688
     def __init__(self, *args, **kwargs):
689  
-        kwargs['max_length'] = 75
  689
+        if 'max_length' not in kwargs:
  690
+            kwargs['max_length'] = 75
690 691
         CharField.__init__(self, *args, **kwargs)
691 692
 
692 693
     def get_internal_type(self):
6  docs/model-api.txt
@@ -221,8 +221,10 @@ The admin represents this as an ``<input type="text">`` (a single-line input).
221 221
 ~~~~~~~~~~~~~~
222 222
 
223 223
 A ``CharField`` that checks that the value is a valid e-mail address.
224  
-This doesn't accept ``max_length``; its ``max_length`` is automatically set to
225  
-75.
  224
+
  225
+In Django 0.96, this doesn't accept ``max_length``; its ``max_length`` is
  226
+automatically set to 75. In the Django development version, ``max_length`` is
  227
+set to 75 by default, but you can specify it to override default behavior.
226 228
 
227 229
 ``FileField``
228 230
 ~~~~~~~~~~~~~

0 notes on commit 0d52d2b

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