Ticket #8911: 1.0-porting-guide.diff
File 1.0-porting-guide.diff, 2.7 KB (added by , 16 years ago) |
---|
-
docs/releases/1.0-porting-guide.txt
42 42 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 43 44 44 Rename your ``maxlength`` argument to ``max_length`` (this was changed to be 45 consist ant with form fields):45 consistent with form fields): 46 46 47 47 Replace ``__str__`` with ``__unicode__`` 48 48 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 473 473 import datetime 474 474 475 475 class Article(models.Model): 476 title = models.CharField(max length=100)476 title = models.CharField(max_length=100) 477 477 published = models.DateField(default=datetime.datetime.now) 478 478 479 479 ``DecimalField`` is new, and ``FloatField`` is now a proper float … … 536 536 this procedure for any of the standard Django models. 537 537 538 538 If something goes wrong in the above process, just copy your backed up 539 database file over the top of theoriginal file and start again.539 database file over the original file and start again. 540 540 541 541 Internationalization 542 542 -------------------- … … 644 644 ``Feed.__init__`` has changed 645 645 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 646 646 647 The ``__init__()`` parameters inthe syndication framework's ``Feed`` class now647 The ``__init__()`` method of the syndication framework's ``Feed`` class now 648 648 take an ``HttpRequest`` object as its second parameter, instead of the feed's 649 649 URL. This allows the syndication framework to work without requiring the sites 650 650 framework. This only affects code that subclass ``Feed`` and overrides the … … 656 656 ``SortedDictFromList`` is gone 657 657 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 658 658 659 ` django.newforms.forms.SortedDictFromList`` was removed.660 :class:`django.utils.datastructures.SortedDict` `can now be instantiated with659 ``django.newforms.forms.SortedDictFromList`` was removed. 660 :class:`django.utils.datastructures.SortedDict` can now be instantiated with 661 661 a sequence of tuples. 662 662 663 663 To update your code: … … 665 665 1. Use :class:`django.utils.datastructures.SortedDict` wherever you were 666 666 using ``django.newforms.forms.SortedDictFromList``. 667 667 668 2. Because :meth:`django.utils.datastructures.SortedDict.copy` returns a669 deepcopy as ``SortedDictFromList`` method did, you will need to update670 your code if you were relying on a deepcopy. Do this by using668 2. Because :meth:`django.utils.datastructures.SortedDict.copy` doesn't 669 return a deepcopy as ``SortedDictFromList.copy()`` did, you will need 670 to update your code if you were relying on a deepcopy. Do this by using 671 671 ``copy.deepcopy`` directly. 672 672 673 673 Database backend functions