Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…paulding and gwilson

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0d52d2b2f90ea12c2ca721a46052b0c17bae3b47 1 parent fe78237
@adrianholovaty adrianholovaty authored
Showing with 6 additions and 3 deletions.
  1. +2 −1  django/db/models/fields/
  2. +4 −2 docs/model-api.txt
3  django/db/models/fields/
@@ -686,7 +686,8 @@ def formfield(self, **kwargs):
class EmailField(CharField):
def __init__(self, *args, **kwargs):
- kwargs['max_length'] = 75
+ if 'max_length' not in kwargs:
+ kwargs['max_length'] = 75
CharField.__init__(self, *args, **kwargs)
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).
A ``CharField`` that checks that the value is a valid e-mail address.
-This doesn't accept ``max_length``; its ``max_length`` is automatically set to
+In Django 0.96, this doesn't accept ``max_length``; its ``max_length`` is
+automatically set to 75. In the Django development version, ``max_length`` is
+set to 75 by default, but you can specify it to override default behavior.
Please sign in to comment.
Something went wrong with that request. Please try again.