Index: django_src/django/core/formfields.py =================================================================== --- django_src/django/core/formfields.py (revision 569) +++ django_src/django/core/formfields.py (working copy) @@ -544,6 +544,15 @@ if not -32768 <= int(field_data) <= 32767: raise validators.CriticalValidationError, "Enter a whole number between -32,768 and 32,767." +class BigIntegerField(IntegerField): + def __init__(self, field_name, length=15, maxlength=20, is_required=False, validator_list=[]): + validator_list = [self.isBigInteger] + validator_list + IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list) + + def isBigInteger(self, field_data, all_data): + if not -9223372036854775808 <= int(field_data) <= 9223372036854775807: + raise validators.CriticalValidationError, "Enter a whole number between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807." + class PositiveIntegerField(IntegerField): def __init__(self, field_name, length=10, maxlength=None, is_required=False, validator_list=[]): validator_list = [self.isPositive] + validator_list @@ -562,6 +571,15 @@ if not 0 <= int(field_data) <= 32767: raise validators.CriticalValidationError, "Enter a whole number between 0 and 32,767." +class PositiveBigIntegerField(IntegerField): + def __init__(self, field_name, length=15, maxlength=20, is_required=False, validator_list=[]): + validator_list = [self.isPositiveBig] + validator_list + IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list) + + def isPositiveBig(self, field_data, all_data): + if not 0 <= int(field_data) <= 18446744073709551615: + raise validators.CriticalValidationError, "Enter a whole number between 0 and 18,446,744,073,709,551,615." + class FloatField(TextField): def __init__(self, field_name, max_digits, decimal_places, is_required=False, validator_list=[]): self.max_digits, self.decimal_places = max_digits, decimal_places Index: django_src/django/core/db/backends/postgresql.py =================================================================== --- django_src/django/core/db/backends/postgresql.py (revision 569) +++ django_src/django/core/db/backends/postgresql.py (working copy) @@ -142,6 +142,7 @@ # If a column type is set to None, it won't be included in the output. DATA_TYPES = { 'AutoField': 'serial', + 'BigIntegerField': 'bigint', 'BooleanField': 'boolean', 'CharField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', @@ -157,6 +158,7 @@ 'NullBooleanField': 'boolean', 'OneToOneField': 'integer', 'PhoneNumberField': 'varchar(20)', + 'PositiveBigIntegerField': 'bigint CHECK (%(name)s >= 0)', 'PositiveIntegerField': 'integer CHECK (%(name)s >= 0)', 'PositiveSmallIntegerField': 'smallint CHECK (%(name)s >= 0)', 'SlugField': 'varchar(50)', @@ -171,6 +173,7 @@ # Maps type codes to Django Field types. DATA_TYPES_REVERSE = { 16: 'BooleanField', + 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'TextField', Index: django_src/django/core/db/backends/sqlite3.py =================================================================== --- django_src/django/core/db/backends/sqlite3.py (revision 569) +++ django_src/django/core/db/backends/sqlite3.py (working copy) @@ -144,6 +144,7 @@ # schema inspection is more useful. DATA_TYPES = { 'AutoField': 'integer', + 'BigIntegerField': 'bigint', 'BooleanField': 'bool', 'CharField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', @@ -159,6 +160,7 @@ 'NullBooleanField': 'bool', 'OneToOneField': 'integer', 'PhoneNumberField': 'varchar(20)', + 'PositiveBigIntegerField': 'bigint unsigned', 'PositiveIntegerField': 'integer unsigned', 'PositiveSmallIntegerField': 'smallint unsigned', 'SlugField': 'varchar(50)', Index: django_src/django/core/db/backends/mysql.py =================================================================== --- django_src/django/core/db/backends/mysql.py (revision 569) +++ django_src/django/core/db/backends/mysql.py (working copy) @@ -107,6 +107,7 @@ # If a column type is set to None, it won't be included in the output. DATA_TYPES = { 'AutoField': 'mediumint(9) unsigned auto_increment', + 'BigIntegerField': 'bigint', 'BooleanField': 'bool', 'CharField': 'varchar(%(maxlength)s)', 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)', @@ -122,6 +123,7 @@ 'NullBooleanField': 'bool', 'OneToOneField': 'integer', 'PhoneNumberField': 'varchar(20)', + 'PositiveBigIntegerField': 'bigint UNSIGNED', 'PositiveIntegerField': 'integer UNSIGNED', 'PositiveSmallIntegerField': 'smallint UNSIGNED', 'SlugField': 'varchar(50)', @@ -143,7 +145,7 @@ FIELD_TYPE.FLOAT: 'FloatField', FIELD_TYPE.INT24: 'IntegerField', FIELD_TYPE.LONG: 'IntegerField', - FIELD_TYPE.LONGLONG: 'IntegerField', + FIELD_TYPE.LONGLONG: 'BigIntegerField', FIELD_TYPE.SHORT: 'IntegerField', FIELD_TYPE.STRING: 'TextField', FIELD_TYPE.TIMESTAMP: 'DateTimeField', Index: django_src/django/core/meta/fields.py =================================================================== --- django_src/django/core/meta/fields.py (revision 569) +++ django_src/django/core/meta/fields.py (working copy) @@ -498,6 +498,14 @@ def get_manipulator_field_objs(self): return [formfields.SmallIntegerField] +class BigIntegerField(IntegerField): + def get_manipulator_field_objs(self): + return [formfields.BigIntegerField] + +class PositiveBigIntegerField(IntegerField): + def get_manipulator_field_objs(self): + return [formfields.PositiveBigIntegerField] + class TextField(Field): def get_manipulator_field_objs(self): return [formfields.LargeTextField] Index: django_src/django/views/admin/doc.py =================================================================== --- django_src/django/views/admin/doc.py (revision 569) +++ django_src/django/views/admin/doc.py (working copy) @@ -280,6 +280,7 @@ # If a column type is set to None, it won't be included in the output. DATA_TYPE_MAPPING = { 'AutoField' : 'Integer', + 'BigIntegerField' : 'Integer', 'BooleanField' : 'Boolean (Either True or False)', 'CharField' : 'String (up to %(maxlength)s)', 'CommaSeparatedIntegerField': 'Comma-separated integers', @@ -295,6 +296,7 @@ 'ManyToManyField' : '', 'NullBooleanField' : 'Boolean (Either True, False or None)', 'PhoneNumberField' : 'Phone number', + 'PositiveBigIntegerField' : 'Integer', 'PositiveIntegerField' : 'Integer', 'PositiveSmallIntegerField' : 'Integer', 'SlugField' : 'String (up to 50)',