From dca8b916ffa391964be26bbd62471d4c11b221fd Mon Sep 17 00:00:00 2001 From: Brobin Date: Sun, 7 Feb 2016 17:22:48 -0600 Subject: Fixed #26154 -- Deprecated CommaSeparatedIntegerField --- docs/internals/deprecation.txt | 3 +++ docs/ref/checks.txt | 2 ++ docs/ref/models/fields.txt | 7 ++++++- docs/releases/1.10.txt | 23 +++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index d5add78423..13d9305658 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -130,6 +130,9 @@ details on these changes. * The ``django.core.urlresolvers`` module will be removed. +* The model ``CommaSeparatedIntegerField`` will be removed. A stub field will + remain for compatibility with historical migrations. + .. _deprecation-removed-in-1.10: 1.10 diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index f6c304bf95..de9633402f 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -165,6 +165,8 @@ Fields * **fields.W900**: ``IPAddressField`` has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9. *This check appeared in Django 1.7 and 1.8*. +* **fields.W901**: ``CommaSeparatedIntegerField`` has been deprecated. Support + for it (except in historical migrations) will be removed in Django 2.0. File Fields ~~~~~~~~~~~ diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 4b100ad98d..4a1c9eefbb 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -471,12 +471,17 @@ The default form widget for this field is a :class:`~django.forms.TextInput`. of. Refer to the :ref:`MySQL database notes ` for details. - ``CommaSeparatedIntegerField`` ------------------------------ .. class:: CommaSeparatedIntegerField(max_length=None, **options) +.. deprecated:: 1.9 + + This field is deprecated in favor of :class:`~django.db.models.CharField` + with ``validators=[``\ :func:`validate_comma_separated_integer_list + `\ ``]``. + A field of integers separated by commas. As in :class:`CharField`, the :attr:`~CharField.max_length` argument is required and the note about database portability mentioned there should be heeded. diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index fd2b1a5d40..adebc46e66 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -561,6 +561,29 @@ This prevents confusion about an assignment resulting in an implicit save. :class:`~django.contrib.gis.geos.MultiPolygon` is deprecated in favor of the :attr:`~django.contrib.gis.geos.GEOSGeometry.unary_union` property. +``CommaSeparatedIntegerField`` model field +------------------------------------------ + +``CommaSeparatedIntegerField`` is deprecated in favor of +:class:`~django.db.models.CharField` with the +:func:`~django.core.validators.validate_comma_separated_integer_list` +validator:: + + from django.core.validators import validate_comma_separated_integer_list + from django.db import models + + class MyModel(models.Model): + numbers = models.CharField(..., validators=[validate_comma_separated_integer_list]) + +If you're using Oracle, ``CharField`` uses a different database field type +(``NVARCHAR2``) than ``CommaSeparatedIntegerField`` (``VARCHAR2``). Depending +on your database settings, this might imply a different encoding, and thus a +different length (in bytes) for the same contents. If your stored values are +longer than the 4000 byte limit of ``NVARCHAR2``, you should use ``TextField`` +(``NCLOB``) instead. In this case, if you have any queries that group by the +field (e.g. annotating the model with an aggregation or using ``distinct()``) +you'll need to change them (to defer the field). + Miscellaneous ------------- -- cgit v1.3