Ticket #231: max_length_cleanups.diff
File max_length_cleanups.diff, 6.8 KB (added by , 17 years ago) |
---|
-
django/db/models/fields/__init__.py
686 686 687 687 class EmailField(CharField): 688 688 def __init__(self, *args, **kwargs): 689 if 'max_length' not in kwargs: 690 kwargs['max_length'] = 75 689 kwargs['max_length'] = kwargs.get('max_length', 75) 691 690 CharField.__init__(self, *args, **kwargs) 692 691 693 692 def get_internal_type(self): … … 707 706 class FileField(Field): 708 707 def __init__(self, verbose_name=None, name=None, upload_to='', **kwargs): 709 708 self.upload_to = upload_to 709 kwargs['max_length'] = kwargs.get('max_length', 100) 710 710 Field.__init__(self, verbose_name, name, **kwargs) 711 711 712 712 def get_db_prep_save(self, value): … … 808 808 class FilePathField(Field): 809 809 def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs): 810 810 self.path, self.match, self.recursive = path, match, recursive 811 kwargs['max_length'] = kwargs.get('max_length', 100) 811 812 Field.__init__(self, verbose_name, name, **kwargs) 812 813 813 814 def get_manipulator_field_objs(self): -
django/db/backends/ado_mssql/creation.py
6 6 'DateField': 'smalldatetime', 7 7 'DateTimeField': 'smalldatetime', 8 8 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 9 'FileField': 'varchar( 100)',10 'FilePathField': 'varchar( 100)',9 'FileField': 'varchar(%(max_length)s)', 10 'FilePathField': 'varchar(%(max_length)s)', 11 11 'FloatField': 'double precision', 12 'ImageField': 'varchar( 100)',12 'ImageField': 'varchar(%(max_length)s)', 13 13 'IntegerField': 'int', 14 14 'IPAddressField': 'char(15)', 15 15 'NullBooleanField': 'bit', -
django/db/backends/mysql_old/creation.py
10 10 'DateField': 'date', 11 11 'DateTimeField': 'datetime', 12 12 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 13 'FileField': 'varchar( 100)',14 'FilePathField': 'varchar( 100)',13 'FileField': 'varchar(%(max_length)s)', 14 'FilePathField': 'varchar(%(max_length)s)', 15 15 'FloatField': 'double precision', 16 'ImageField': 'varchar( 100)',16 'ImageField': 'varchar(%(max_length)s)', 17 17 'IntegerField': 'integer', 18 18 'IPAddressField': 'char(15)', 19 19 'NullBooleanField': 'bool', -
django/db/backends/postgresql/creation.py
10 10 'DateField': 'date', 11 11 'DateTimeField': 'timestamp with time zone', 12 12 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 13 'FileField': 'varchar( 100)',14 'FilePathField': 'varchar( 100)',13 'FileField': 'varchar(%(max_length)s)', 14 'FilePathField': 'varchar(%(max_length)s)', 15 15 'FloatField': 'double precision', 16 'ImageField': 'varchar( 100)',16 'ImageField': 'varchar(%(max_length)s)', 17 17 'IntegerField': 'integer', 18 18 'IPAddressField': 'inet', 19 19 'NullBooleanField': 'boolean', -
django/db/backends/sqlite3/creation.py
9 9 'DateField': 'date', 10 10 'DateTimeField': 'datetime', 11 11 'DecimalField': 'decimal', 12 'FileField': 'varchar( 100)',13 'FilePathField': 'varchar( 100)',12 'FileField': 'varchar(%(max_length)s)', 13 'FilePathField': 'varchar(%(max_length)s)', 14 14 'FloatField': 'real', 15 'ImageField': 'varchar( 100)',15 'ImageField': 'varchar(%(max_length)s)', 16 16 'IntegerField': 'integer', 17 17 'IPAddressField': 'char(15)', 18 18 'NullBooleanField': 'bool', -
django/db/backends/mysql/creation.py
10 10 'DateField': 'date', 11 11 'DateTimeField': 'datetime', 12 12 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 13 'FileField': 'varchar( 100)',14 'FilePathField': 'varchar( 100)',13 'FileField': 'varchar(%(max_length)s)', 14 'FilePathField': 'varchar(%(max_length)s)', 15 15 'FloatField': 'double precision', 16 'ImageField': 'varchar( 100)',16 'ImageField': 'varchar(%(max_length)s)', 17 17 'IntegerField': 'integer', 18 18 'IPAddressField': 'char(15)', 19 19 'NullBooleanField': 'bool', -
django/db/backends/oracle/creation.py
13 13 'DateField': 'DATE', 14 14 'DateTimeField': 'TIMESTAMP', 15 15 'DecimalField': 'NUMBER(%(max_digits)s, %(decimal_places)s)', 16 'FileField': 'NVARCHAR2( 100)',17 'FilePathField': 'NVARCHAR2( 100)',16 'FileField': 'NVARCHAR2(%(max_length)s)', 17 'FilePathField': 'NVARCHAR2(%(max_length)s)', 18 18 'FloatField': 'DOUBLE PRECISION', 19 'ImageField': 'NVARCHAR2( 100)',19 'ImageField': 'NVARCHAR2(%(max_length)s)', 20 20 'IntegerField': 'NUMBER(11)', 21 21 'IPAddressField': 'VARCHAR2(15)', 22 22 'NullBooleanField': 'NUMBER(1) CHECK ((%(column)s IN (0,1)) OR (%(column)s IS NULL))', … … 28 28 'SmallIntegerField': 'NUMBER(11)', 29 29 'TextField': 'NCLOB', 30 30 'TimeField': 'TIMESTAMP', 31 'URLField': 'VARCHAR2( 200)',31 'URLField': 'VARCHAR2(%(max_length)s)', 32 32 'USStateField': 'CHAR(2)', 33 33 } 34 34