Ticket #399: 399.diff

File 399.diff, 5.1 KB (added by Marc Fargas <telenieko@…>, 8 years ago)

Last patch with docs added.

  • django/contrib/admin/views/doc.py

    === modified file 'django/contrib/admin/views/doc.py'
     
    301301    'ForeignKey'                : _('Integer'),
    302302    'ImageField'                : _('File path'),
    303303    'IntegerField'              : _('Integer'),
     304    'BigIntegerField'           : _('Integer'),
    304305    'IPAddressField'            : _('IP address'),
    305306    'ManyToManyField'           : '',
    306307    'NullBooleanField'          : _('Boolean (Either True, False or None)'),
    307308    'OneToOneField'             : _('Relation to parent model'),
    308309    'PhoneNumberField'          : _('Phone number'),
    309310    'PositiveIntegerField'      : _('Integer'),
     311    'PositiveBigIntegerField'   : _('Integer'),
    310312    'PositiveSmallIntegerField' : _('Integer'),
    311313    'SlugField'                 : _('String (up to %(maxlength)s)'),
    312314    'SmallIntegerField'         : _('Integer'),
  • django/db/backends/mysql/creation.py

    === modified file 'django/db/backends/mysql/creation.py'
     
    1414    'FloatField':        'numeric(%(max_digits)s, %(decimal_places)s)',
    1515    'ImageField':        'varchar(100)',
    1616    'IntegerField':      'integer',
     17    'BigIntegerField':   'bigint',
    1718    'IPAddressField':    'char(15)',
    1819    'ManyToManyField':   None,
    1920    'NullBooleanField':  'bool',
    2021    'OneToOneField':     'integer',
    2122    'PhoneNumberField':  'varchar(20)',
    2223    'PositiveIntegerField': 'integer UNSIGNED',
     24    'PositiveBigIntegerField': 'bigint UNSIGNED',   
    2325    'PositiveSmallIntegerField': 'smallint UNSIGNED',
    2426    'SlugField':         'varchar(%(maxlength)s)',
    2527    'SmallIntegerField': 'smallint',
  • django/db/backends/mysql/introspection.py

    === modified file 'django/db/backends/mysql/introspection.py'
     
    8383    FIELD_TYPE.FLOAT: 'FloatField',
    8484    FIELD_TYPE.INT24: 'IntegerField',
    8585    FIELD_TYPE.LONG: 'IntegerField',
    86     FIELD_TYPE.LONGLONG: 'IntegerField',
     86    FIELD_TYPE.LONGLONG: 'BigIntegerField',
    8787    FIELD_TYPE.SHORT: 'IntegerField',
    8888    FIELD_TYPE.STRING: 'CharField',
    8989    FIELD_TYPE.TIMESTAMP: 'DateTimeField',
  • django/db/models/fields/__init__.py

    === modified file 'django/db/models/fields/__init__.py'
     
    729729        defaults.update(kwargs)
    730730        return super(IntegerField, self).formfield(**defaults)
    731731
     732class BigIntegerField(IntegerField):
     733    def get_manipulator_field_objs(self):
     734        return [oldforms.BigIntegerField]
     735
     736class PositiveBigIntegerField(IntegerField):
     737    def get_manipulator_field_objs(self):
     738        return [oldforms.PositiveBigIntegerField]   
     739
    732740class IPAddressField(Field):
    733741    def __init__(self, *args, **kwargs):
    734742        kwargs['maxlength'] = 15
  • django/oldforms/__init__.py

    === modified file 'django/oldforms/__init__.py'
     
    749749        if not 0 <= int(field_data) <= 32767:
    750750            raise validators.CriticalValidationError, gettext("Enter a whole number between 0 and 32,767.")
    751751
     752class BigIntegerField(IntegerField):
     753    def __init__(self, field_name, length=20, maxlength=None, is_required=False, validator_list=None, member_name=None):
     754        if validator_list is None: validator_list = []
     755        validator_list = [self.isInteger] + validator_list
     756        if member_name is not None:
     757            self.member_name = member_name
     758        IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list)
     759
     760class PositiveBigIntegerField(PositiveIntegerField):
     761    def __init__(self, field_name, length=20, maxlength=None, is_required=False, validator_list=None):
     762        if validator_list is None: validator_list = []
     763        validator_list = [self.isPositive] + validator_list
     764        IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list)
     765
    752766class FloatField(TextField):
    753767    def __init__(self, field_name, max_digits, decimal_places, is_required=False, validator_list=None):
    754768        if validator_list is None: validator_list = []
  • docs/model-api.txt

    === modified file 'docs/model-api.txt'
     
    126126automatically be added to your model if you don't specify otherwise. See
    127127`Automatic primary key fields`_.
    128128
     129``BigIntegerField``
     130~~~~~~~~~~~~~~~~
     131
     132A big integer.
     133
     134The admin represents this as an ``<input type="text">`` (a single-line input).
     135
     136It like an ``IntegerField``, except that it fits bigger numbers.
     137
    129138``BooleanField``
    130139~~~~~~~~~~~~~~~~
    131140
     
    353362A ``CharField`` that checks that the value is a valid U.S.A.-style phone
    354363number (in the format ``XXX-XXX-XXXX``).
    355364
     365``PositiveBigIntegerField``
     366~~~~~~~~~~~~~~~~
     367
     368Just like a ``BigIntegerField``, but must be positive.
     369
    356370``PositiveIntegerField``
    357371~~~~~~~~~~~~~~~~~~~~~~~~
    358372
Back to Top