Ticket #399: bigint_patch_03jan07.diff
File bigint_patch_03jan07.diff, 4.4 KB (added by , 18 years ago) |
---|
-
oldforms/__init__.py
744 744 if not 0 <= int(field_data) <= 32767: 745 745 raise validators.CriticalValidationError, gettext("Enter a whole number between 0 and 32,767.") 746 746 747 class BigIntegerField(IntegerField): 748 def __init__(self, field_name, length=20, maxlength=None, is_required=False, validator_list=None, member_name=None): 749 if validator_list is None: validator_list = [] 750 validator_list = [self.isInteger] + validator_list 751 if member_name is not None: 752 self.member_name = member_name 753 IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list) 754 755 class PositiveBigIntegerField(PositiveIntegerField): 756 def __init__(self, field_name, length=20, maxlength=None, is_required=False, validator_list=None): 757 if validator_list is None: validator_list = [] 758 validator_list = [self.isPositive] + validator_list 759 IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list) 760 747 761 class FloatField(TextField): 748 762 def __init__(self, field_name, max_digits, decimal_places, is_required=False, validator_list=None): 749 763 if validator_list is None: validator_list = [] -
db/models/fields/__init__.py
703 703 def formfield(self, initial=None): 704 704 return forms.IntegerField(required=not self.blank, label=capfirst(self.verbose_name), initial=initial) 705 705 706 class BigIntegerField(IntegerField): 707 def get_manipulator_field_objs(self): 708 return [oldforms.BigIntegerField] 709 710 class PositiveBigIntegerField(IntegerField): 711 def get_manipulator_field_objs(self): 712 return [oldforms.PositiveBigIntegerField] 713 706 714 class IPAddressField(Field): 707 715 def __init__(self, *args, **kwargs): 708 716 kwargs['maxlength'] = 15 -
db/backends/mysql/introspection.py
83 83 FIELD_TYPE.FLOAT: 'FloatField', 84 84 FIELD_TYPE.INT24: 'IntegerField', 85 85 FIELD_TYPE.LONG: 'IntegerField', 86 FIELD_TYPE.LONGLONG: ' IntegerField',86 FIELD_TYPE.LONGLONG: 'BigIntegerField', 87 87 FIELD_TYPE.SHORT: 'IntegerField', 88 88 FIELD_TYPE.STRING: 'TextField', 89 89 FIELD_TYPE.TIMESTAMP: 'DateTimeField', -
db/backends/mysql/creation.py
14 14 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)', 15 15 'ImageField': 'varchar(100)', 16 16 'IntegerField': 'integer', 17 'BigIntegerField': 'bigint', 17 18 'IPAddressField': 'char(15)', 18 19 'ManyToManyField': None, 19 20 'NullBooleanField': 'bool', 20 21 'OneToOneField': 'integer', 21 22 'PhoneNumberField': 'varchar(20)', 22 23 'PositiveIntegerField': 'integer UNSIGNED', 24 'PositiveBigIntegerField': 'bigint UNSIGNED', 23 25 'PositiveSmallIntegerField': 'smallint UNSIGNED', 24 26 'SlugField': 'varchar(%(maxlength)s)', 25 27 'SmallIntegerField': 'smallint', -
contrib/admin/views/doc.py
301 301 'ForeignKey' : _('Integer'), 302 302 'ImageField' : _('File path'), 303 303 'IntegerField' : _('Integer'), 304 'BigIntegerField' : _('Integer'), 304 305 'IPAddressField' : _('IP address'), 305 306 'ManyToManyField' : '', 306 307 'NullBooleanField' : _('Boolean (Either True, False or None)'), 307 308 'OneToOneField' : _('Relation to parent model'), 308 309 'PhoneNumberField' : _('Phone number'), 309 310 'PositiveIntegerField' : _('Integer'), 311 'PositiveBigIntegerField' : _('Integer'), 310 312 'PositiveSmallIntegerField' : _('Integer'), 311 313 'SlugField' : _('String (up to %(maxlength)s)'), 312 314 'SmallIntegerField' : _('Integer'),