From d778326c52701579281f633c8115d9c836e09d58 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 20 Nov 2005 22:41:41 +0000 Subject: [PATCH] Gave EmailField a get_internal_type() method and removed it from DATA_TYPES in all the database backends git-svn-id: http://code.djangoproject.com/svn/django/trunk@1316 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/db/backends/ado_mssql.py | 1 - django/core/db/backends/mysql.py | 1 - django/core/db/backends/postgresql.py | 1 - django/core/db/backends/sqlite3.py | 1 - django/core/meta/fields.py | 7 +++++++ 5 files changed, 7 insertions(+), 4 deletions(-) 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]