Ticket #3094: XMLField_deprecation.diff

File XMLField_deprecation.diff, 5.6 KB (added by Paul McMillan, 14 years ago)
  • docs/internals/deprecation.txt

     
    4141          removed.
    4242
    4343        * The ``get_db_prep_save``, ``get_db_prep_value`` and
    44           ``get_db_prep_lookup`` methods on Field were modified in 1.2 to support
    45           multiple databases. In 1.4, the support functions that allow methods
    46           with the old prototype to continue working will be removed.
     44          ``get_db_prep_lookup`` methods on Field were modified in 1.2
     45          to support multiple databases. In 1.4, the support functions
     46          that allow methods with the old prototype to continue
     47          working will be removed.
    4748
    4849        * The ``Message`` model (in ``django.contrib.auth``), its related
    4950          manager in the ``User`` model (``user.message_set``), and the
     
    105106          with a trailing slash to ensure there is a consistent way to
    106107          combine paths in templates.
    107108
     109        * ``XMLField`` was deprecated in 1.3 and will be removed in
     110          1.4. This accelerated process was chosen since the field
     111          hasn't worked properly since oldforms was removed.
     112
    108113    * 1.5
    109114        * The ``mod_python`` request handler has been deprecated since the 1.3
    110115          release. The ``mod_wsgi`` handler should be used instead.
  • docs/topics/forms/modelforms.txt

     
    106106
    107107    ``URLField``                     ``URLField`` with ``verify_exists`` set
    108108                                     to the model field's ``verify_exists``
    109 
    110     ``XMLField``                     ``CharField`` with
    111                                      ``widget=forms.Textarea``
    112109    ===============================  ========================================
    113110
    114111.. versionadded:: 1.2
  • docs/ref/models/fields.txt

     
    836836``XMLField``
    837837------------
    838838
     839.. versionchanged:: 1.3
     840   ``XMLField`` is deprecated. Use TextField instead.
     841
    839842.. class:: XMLField(schema_path=None, [**options])
    840843
    841 A :class:`TextField` that checks that the value is valid XML that matches a
    842 given schema. Takes one required argument:
     844A :class:`TextField` that stores XML data and a path to a schema. Takes one
     845optional argument:
    843846
    844847.. attribute:: schema_path
    845848
    846     The filesystem path to a RelaxNG_ schema against which to validate the
    847     field.
     849    The filesystem path to a schema for the field.
    848850
    849 .. _RelaxNG: http://www.relaxng.org/
    850851
    851852Relationship fields
    852853===================
  • tests/regressiontests/serializers_regress/tests.py

     
    222222    (data_obj, 180, USStateData, "MA"),
    223223    (data_obj, 181, USStateData, None),
    224224    (data_obj, 182, USStateData, ""),
    225     (data_obj, 190, XMLData, "<foo></foo>"),
    226     (data_obj, 191, XMLData, None),
    227     (data_obj, 192, XMLData, ""),
    228225
    229226    (generic_obj, 200, GenericData, ['Generic Object 1', 'tag1', 'tag2']),
    230227    (generic_obj, 201, GenericData, ['Generic Object 2', 'tag2', 'tag3']),
  • tests/regressiontests/serializers_regress/models.py

     
    7979class USStateData(models.Model):
    8080    data = USStateField(null=True)
    8181
    82 class XMLData(models.Model):
    83     data = models.XMLField(null=True)
    84 
    8582class Tag(models.Model):
    8683    """A tag on an item."""
    8784    data = models.SlugField()
     
    218215class USStatePKData(models.Model):
    219216    data = USStateField(primary_key=True)
    220217
    221 # class XMLPKData(models.Model):
    222 #     data = models.XMLField(primary_key=True)
    223 
    224218class ComplexModel(models.Model):
    225219    field1 = models.CharField(max_length=10)
    226220    field2 = models.CharField(max_length=10)
  • django/db/models/fields/__init__.py

     
    11361136    description = _("XML text")
    11371137
    11381138    def __init__(self, verbose_name=None, name=None, schema_path=None, **kwargs):
     1139        import warnings
     1140        warnings.warn("XMLField is deprecated, please migrate to "
     1141                      "TextField for equivalent functionality",
     1142                      DeprecationWarning)
    11391143        self.schema_path = schema_path
    11401144        Field.__init__(self, verbose_name, name, **kwargs)
    11411145
  • django/contrib/gis/utils/layermapping.py

     
    5454        models.TextField : OFTString,
    5555        models.URLField : OFTString,
    5656        USStateField : OFTString,
     57        #This is a reminder that XMLField is deprecated
     58        # and this needs to be removed in 1.4
    5759        models.XMLField : OFTString,
    5860        models.SmallIntegerField : (OFTInteger, OFTReal, OFTString),
    5961        models.PositiveSmallIntegerField : (OFTInteger, OFTReal, OFTString),
Back to Top