Ticket #231: maxlength_for_filefields.diff
File maxlength_for_filefields.diff, 5.3 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
582 582 class FileField(Field): 583 583 def __init__(self, verbose_name=None, name=None, upload_to='', **kwargs): 584 584 self.upload_to = upload_to 585 if 'maxlength' not in kwargs: 586 kwargs['maxlength'] = 100 585 587 Field.__init__(self, verbose_name, name, **kwargs) 586 588 587 589 def get_manipulator_fields(self, opts, manipulator, change, name_prefix='', rel=False, follow=True): … … 663 665 class FilePathField(Field): 664 666 def __init__(self, verbose_name=None, name=None, path='', match=None, recursive=False, **kwargs): 665 667 self.path, self.match, self.recursive = path, match, recursive 668 if 'maxlength' not in kwargs: 669 kwargs['maxlength'] = 100 666 670 Field.__init__(self, verbose_name, name, **kwargs) 667 671 668 672 def get_manipulator_field_objs(self): -
django/db/backends/ado_mssql/creation.py
5 5 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 6 6 'DateField': 'smalldatetime', 7 7 'DateTimeField': 'smalldatetime', 8 'FileField': 'varchar( 100)',9 'FilePathField': 'varchar( 100)',8 'FileField': 'varchar(%(maxlength)s)', 9 'FilePathField': 'varchar(%(maxlength)s)', 10 10 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 11 'ImageField': 'varchar( 100)',11 'ImageField': 'varchar(%(maxlength)s)', 12 12 'IntegerField': 'int', 13 13 'IPAddressField': 'char(15)', 14 14 'ManyToManyField': None, -
django/db/backends/postgresql/creation.py
9 9 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 10 10 'DateField': 'date', 11 11 'DateTimeField': 'timestamp with time zone', 12 'FileField': 'varchar( 100)',13 'FilePathField': 'varchar( 100)',12 'FileField': 'varchar(%(maxlength)s)', 13 'FilePathField': 'varchar(%(maxlength)s)', 14 14 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 15 'ImageField': 'varchar( 100)',15 'ImageField': 'varchar(%(maxlength)s)', 16 16 'IntegerField': 'integer', 17 17 'IPAddressField': 'inet', 18 18 'ManyToManyField': None, -
django/db/backends/sqlite3/creation.py
8 8 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 9 9 'DateField': 'date', 10 10 'DateTimeField': 'datetime', 11 'FileField': 'varchar( 100)',12 'FilePathField': 'varchar( 100)',11 'FileField': 'varchar(%(maxlength)s)', 12 'FilePathField': 'varchar(%(maxlength)s)', 13 13 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 14 'ImageField': 'varchar( 100)',14 'ImageField': 'varchar(%(maxlength)s)', 15 15 'IntegerField': 'integer', 16 16 'IPAddressField': 'char(15)', 17 17 'ManyToManyField': None, -
django/db/backends/mysql/creation.py
9 9 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', 10 10 'DateField': 'date', 11 11 'DateTimeField': 'datetime', 12 'FileField': 'varchar( 100)',13 'FilePathField': 'varchar( 100)',12 'FileField': 'varchar(%(maxlength)s)', 13 'FilePathField': 'varchar(%(maxlength)s)', 14 14 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 15 'ImageField': 'varchar( 100)',15 'ImageField': 'varchar(%(maxlength)s)', 16 16 'IntegerField': 'integer', 17 17 'IPAddressField': 'char(15)', 18 18 'ManyToManyField': None, -
django/db/backends/oracle/creation.py
5 5 'CommaSeparatedIntegerField': 'varchar2(%(maxlength)s)', 6 6 'DateField': 'date', 7 7 'DateTimeField': 'date', 8 'FileField': 'varchar2( 100)',9 'FilePathField': 'varchar2( 100)',8 'FileField': 'varchar2(%(maxlength)s)', 9 'FilePathField': 'varchar2(%(maxlength)s)', 10 10 'FloatField': 'number(%(max_digits)s, %(decimal_places)s)', 11 'ImageField': 'varchar2( 100)',11 'ImageField': 'varchar2(%(maxlength)s)', 12 12 'IntegerField': 'integer', 13 13 'IPAddressField': 'char(15)', 14 14 'ManyToManyField': None,