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
This commit is contained in:
Adrian Holovaty 2005-11-20 22:41:41 +00:00
parent 9347f748b0
commit d778326c52
5 changed files with 7 additions and 4 deletions

View File

@ -138,7 +138,6 @@ DATA_TYPES = {
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'smalldatetime', 'DateField': 'smalldatetime',
'DateTimeField': 'smalldatetime', 'DateTimeField': 'smalldatetime',
'EmailField': 'varchar(75)',
'FileField': 'varchar(100)', 'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)', 'FilePathField': 'varchar(100)',
'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',

View File

@ -154,7 +154,6 @@ DATA_TYPES = {
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'date', 'DateField': 'date',
'DateTimeField': 'datetime', 'DateTimeField': 'datetime',
'EmailField': 'varchar(75)',
'FileField': 'varchar(100)', 'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)', 'FilePathField': 'varchar(100)',
'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',

View File

@ -159,7 +159,6 @@ DATA_TYPES = {
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'date', 'DateField': 'date',
'DateTimeField': 'timestamp with time zone', 'DateTimeField': 'timestamp with time zone',
'EmailField': 'varchar(75)',
'FileField': 'varchar(100)', 'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)', 'FilePathField': 'varchar(100)',
'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',

View File

@ -157,7 +157,6 @@ DATA_TYPES = {
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'date', 'DateField': 'date',
'DateTimeField': 'datetime', 'DateTimeField': 'datetime',
'EmailField': 'varchar(75)',
'FileField': 'varchar(100)', 'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)', 'FilePathField': 'varchar(100)',
'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',

View File

@ -390,6 +390,13 @@ class DateTimeField(DateField):
return self.get_default() return self.get_default()
class EmailField(Field): 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): def get_manipulator_field_objs(self):
return [formfields.EmailField] return [formfields.EmailField]