diff --git a/django/core/db/backends/ado_mssql.py b/django/core/db/backends/ado_mssql.py index cc2f861ea7..709d35a583 100644 --- a/django/core/db/backends/ado_mssql.py +++ b/django/core/db/backends/ado_mssql.py @@ -138,7 +138,6 @@ DATA_TYPES = { 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'DateField': 'smalldatetime', 'DateTimeField': 'smalldatetime', - 'EmailField': 'varchar(75)', 'FileField': 'varchar(100)', 'FilePathField': 'varchar(100)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index dd94948b96..27d166f8d1 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -154,7 +154,6 @@ DATA_TYPES = { 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'DateField': 'date', 'DateTimeField': 'datetime', - 'EmailField': 'varchar(75)', 'FileField': 'varchar(100)', 'FilePathField': 'varchar(100)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', diff --git a/django/core/db/backends/postgresql.py b/django/core/db/backends/postgresql.py index b1b2d9cb52..03864a5707 100644 --- a/django/core/db/backends/postgresql.py +++ b/django/core/db/backends/postgresql.py @@ -159,7 +159,6 @@ DATA_TYPES = { 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'DateField': 'date', 'DateTimeField': 'timestamp with time zone', - 'EmailField': 'varchar(75)', 'FileField': 'varchar(100)', 'FilePathField': 'varchar(100)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', diff --git a/django/core/db/backends/sqlite3.py b/django/core/db/backends/sqlite3.py index 60ffd37620..6fa49131ee 100644 --- a/django/core/db/backends/sqlite3.py +++ b/django/core/db/backends/sqlite3.py @@ -157,7 +157,6 @@ DATA_TYPES = { 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'DateField': 'date', 'DateTimeField': 'datetime', - 'EmailField': 'varchar(75)', 'FileField': 'varchar(100)', 'FilePathField': 'varchar(100)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', diff --git a/django/core/meta/fields.py b/django/core/meta/fields.py index 06403f0a31..bf836c8390 100644 --- a/django/core/meta/fields.py +++ b/django/core/meta/fields.py @@ -390,6 +390,13 @@ class DateTimeField(DateField): return self.get_default() class EmailField(Field): + def __init__(self, *args, **kwargs): + kwargs['maxlength'] = 75 + Field.__init__(self, *args, **kwargs) + + def get_internal_type(self): + return "CharField" + def get_manipulator_field_objs(self): return [formfields.EmailField]