Ticket #399: bigint-patch-2009-10-26.diff
File bigint-patch-2009-10-26.diff, 7.6 KB (added by , 15 years ago) |
---|
-
django/db/models/fields/__init__.py
714 714 defaults.update(kwargs) 715 715 return super(IntegerField, self).formfield(**defaults) 716 716 717 class BigIntegerField(IntegerField): 718 MAX_BIGINT = 9223372036854775807 719 empty_strings_allowed = False 720 def get_internal_type(self): 721 return "BigIntegerField" 722 723 def get_db_prep_save(self, value): 724 value = long(value) 725 if value > self.MAX_BIGINT or value < -self.MAX_BIGINT - 1: 726 raise ValueError("Value is to small/large to fit this field") 727 return super(BigIntegerField, self).get_db_prep_save(value) 728 729 717 730 class IPAddressField(Field): 718 731 empty_strings_allowed = False 719 732 def __init__(self, *args, **kwargs): -
django/db/backends/postgresql/introspection.py
4 4 # Maps type codes to Django Field types. 5 5 data_types_reverse = { 6 6 16: 'BooleanField', 7 20: 'BigIntegerField', 7 8 21: 'SmallIntegerField', 8 9 23: 'IntegerField', 9 10 25: 'TextField', -
django/db/backends/postgresql/creation.py
18 18 'FilePathField': 'varchar(%(max_length)s)', 19 19 'FloatField': 'double precision', 20 20 'IntegerField': 'integer', 21 'BigIntegerField': 'bigint', 21 22 'IPAddressField': 'inet', 22 23 'NullBooleanField': 'boolean', 23 24 'OneToOneField': 'integer', -
django/db/backends/sqlite3/introspection.py
16 16 'smallinteger': 'SmallIntegerField', 17 17 'int': 'IntegerField', 18 18 'integer': 'IntegerField', 19 'bigint': 'BigIntegerField', 19 20 'integer unsigned': 'PositiveIntegerField', 20 21 'decimal': 'DecimalField', 21 22 'real': 'FloatField', -
django/db/backends/sqlite3/creation.py
19 19 'FilePathField': 'varchar(%(max_length)s)', 20 20 'FloatField': 'real', 21 21 'IntegerField': 'integer', 22 'IntegerField': 'bigint', 22 23 'IPAddressField': 'char(15)', 23 24 'NullBooleanField': 'bool', 24 25 'OneToOneField': 'integer', -
django/db/backends/mysql/introspection.py
17 17 FIELD_TYPE.FLOAT: 'FloatField', 18 18 FIELD_TYPE.INT24: 'IntegerField', 19 19 FIELD_TYPE.LONG: 'IntegerField', 20 FIELD_TYPE.LONGLONG: ' IntegerField',20 FIELD_TYPE.LONGLONG: 'BigIntegerField', 21 21 FIELD_TYPE.SHORT: 'IntegerField', 22 22 FIELD_TYPE.STRING: 'CharField', 23 23 FIELD_TYPE.TIMESTAMP: 'DateTimeField', -
django/db/backends/mysql/creation.py
18 18 'FilePathField': 'varchar(%(max_length)s)', 19 19 'FloatField': 'double precision', 20 20 'IntegerField': 'integer', 21 'BigIntegerField': 'bigint', 21 22 'IPAddressField': 'char(15)', 22 23 'NullBooleanField': 'bool', 23 24 'OneToOneField': 'integer', … … 63 64 field.rel.to._meta.db_table, field.rel.to._meta.pk.column) 64 65 ] 65 66 return table_output, deferred 66 67 No newline at end of file 67 -
django/db/backends/oracle/creation.py
27 27 'FilePathField': 'NVARCHAR2(%(max_length)s)', 28 28 'FloatField': 'DOUBLE PRECISION', 29 29 'IntegerField': 'NUMBER(11)', 30 'BigIntegerField': 'NUMBER(19)', 30 31 'IPAddressField': 'VARCHAR2(15)', 31 32 'NullBooleanField': 'NUMBER(1) CHECK ((%(qn_column)s IN (0,1)) OR (%(qn_column)s IS NULL))', 32 33 'OneToOneField': 'NUMBER(11)', -
django/contrib/comments/templates/comments/preview.html
1 1 {% extends "comments/base.html" %} 2 2 {% load i18n %} 3 {%sd %} 3 4 4 5 {% block title %}{% trans "Preview your comment" %}{% endblock %} 5 6 -
django/contrib/admin/options.py
40 40 'form_class': forms.SplitDateTimeField, 41 41 'widget': widgets.AdminSplitDateTime 42 42 }, 43 models.DateField: {'widget': widgets.AdminDateWidget}, 44 models.TimeField: {'widget': widgets.AdminTimeWidget}, 45 models.TextField: {'widget': widgets.AdminTextareaWidget}, 46 models.URLField: {'widget': widgets.AdminURLFieldWidget}, 47 models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget}, 48 models.CharField: {'widget': widgets.AdminTextInputWidget}, 49 models.ImageField: {'widget': widgets.AdminFileWidget}, 50 models.FileField: {'widget': widgets.AdminFileWidget}, 43 models.DateField: {'widget': widgets.AdminDateWidget}, 44 models.TimeField: {'widget': widgets.AdminTimeWidget}, 45 models.TextField: {'widget': widgets.AdminTextareaWidget}, 46 models.URLField: {'widget': widgets.AdminURLFieldWidget}, 47 models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget}, 48 models.BigIntegerField: {'widget': widgets.AdminIntegerFieldWidget}, 49 models.CharField: {'widget': widgets.AdminTextInputWidget}, 50 models.ImageField: {'widget': widgets.AdminFileWidget}, 51 models.FileField: {'widget': widgets.AdminFileWidget}, 51 52 } 52 53 53 54 -
docs/ref/models/fields.txt
641 641 An integer. The admin represents this as an ``<input type="text">`` (a 642 642 single-line input). 643 643 644 ``bigintegerfield`` 645 ~~~~~~~~~~~~~~~~ 646 647 .. class:: BigIntegerField([**options]) 648 649 A big integer. The admin represents this as an ``<input type="text">`` 650 (a single-line input). 651 652 a 64 bit type like an ``integerfield``, except that it fits numbers from 653 -9223372036854775808 to 9223372036854775807 654 655 644 656 ``IPAddressField`` 645 657 ------------------ 646 658