Reorganize the beta release notes a bit and trim down the section on feeds.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2638c90ce2
commit
f30f1514f3
|
@ -23,23 +23,21 @@ This document covers changes since the Django 1.2 alpha release; the
|
||||||
updated features in Django between 1.1 and 1.2 alpha.
|
updated features in Django between 1.1 and 1.2 alpha.
|
||||||
|
|
||||||
|
|
||||||
What's new in 1.2 beta
|
Deprecations and other changes in 1.2 beta
|
||||||
======================
|
==========================================
|
||||||
|
|
||||||
This 1.2 beta release marks the final feature freeze for Django 1.2;
|
This beta release deprecates one portion of public API, and introduces
|
||||||
while most feature development was completed for 1.2 alpha (which
|
a potentially backwards-incompatible change to another. Under `our API
|
||||||
constituted a freeze on major features), a few other new features were
|
stability policy <misc-api-stability>`, deprecation proceeds over
|
||||||
added afterward and so are new as of 1.2 beta.
|
multiple release cycles: initially, the deprecated API will raise
|
||||||
|
``PendingDeprecationWarning``, followed by raising
|
||||||
Additionally, some existing APIs have been deprecated; under `our API
|
``DeprecationWarning`` in the following release, and finally removal
|
||||||
stability policy <misc-api-stability>`, these APIs will continue to
|
of the deprecated API. APIs beginning the deprecation process in
|
||||||
work for now, but will raise ``PendingDeprecationWarning`` in Django
|
Django 1.2 will be removed in the Django 1.4 release.
|
||||||
1.2 and ``DeprecationWarning`` in Django 1.3, before being removed in
|
|
||||||
Django 1.4.
|
|
||||||
|
|
||||||
|
|
||||||
Class-based test runners
|
Unit test runners
|
||||||
------------------------
|
-----------------
|
||||||
|
|
||||||
Django 1.2 changes the test runner tools to use a class-based
|
Django 1.2 changes the test runner tools to use a class-based
|
||||||
approach. Old style function-based test runners will still work, but
|
approach. Old style function-based test runners will still work, but
|
||||||
|
@ -47,79 +45,17 @@ should be updated to use the new :ref:`class-based runners
|
||||||
<topics-testing-test_runner>`.
|
<topics-testing-test_runner>`.
|
||||||
|
|
||||||
|
|
||||||
``Feed`` in ``django.contrib.syndication.feeds``
|
Syndication feeds
|
||||||
------------------------------------------------
|
-----------------
|
||||||
|
|
||||||
The :class:`django.contrib.syndication.feeds.Feed` class is being
|
The :class:`django.contrib.syndication.feeds.Feed` class is being
|
||||||
replaced by the :class:`django.contrib.syndication.views.Feed` class.
|
replaced by the :class:`django.contrib.syndication.views.Feed` class.
|
||||||
The old ``feeds.Feed`` class is deprecated, and will be removed in
|
The old ``feeds.Feed`` class is deprecated. The new class has an
|
||||||
Django 1.4.
|
almost identical API, but allows instances to be used as views.
|
||||||
|
|
||||||
The new class has an almost identical API, but allows instances to be
|
Also, in accordance with `RSS best practices`_, RSS feeds will now
|
||||||
used as views. For example, consider the use of the old framework in
|
include an ``atom:link`` element. You may need to update your tests to
|
||||||
the following :ref:`URLconf <topics-http-urls>`::
|
take this into account.
|
||||||
|
|
||||||
from django.conf.urls.defaults import *
|
|
||||||
from myproject.feeds import LatestEntries, LatestEntriesByCategory
|
|
||||||
|
|
||||||
feeds = {
|
|
||||||
'latest': LatestEntries,
|
|
||||||
'categories': LatestEntriesByCategory,
|
|
||||||
}
|
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
|
||||||
# ...
|
|
||||||
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
|
|
||||||
{'feed_dict': feeds}),
|
|
||||||
# ...
|
|
||||||
)
|
|
||||||
|
|
||||||
Using the new Feed class, these feeds can be deployed directly as views::
|
|
||||||
|
|
||||||
from django.conf.urls.defaults import *
|
|
||||||
from myproject.feeds import LatestEntries, LatestEntriesByCategory
|
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
|
||||||
# ...
|
|
||||||
(r'^feeds/latest/$', LatestEntries()),
|
|
||||||
(r'^feeds/categories/(?P<category_id>\d+)/$', LatestEntriesByCategory()),
|
|
||||||
# ...
|
|
||||||
)
|
|
||||||
|
|
||||||
If you currently use the ``feed()`` view, the ``LatestEntries`` class
|
|
||||||
would not need to be modified apart from subclassing the new
|
|
||||||
:class:`~django.contrib.syndication.views.Feed` class.
|
|
||||||
|
|
||||||
However, ``LatestEntriesByCategory`` uses the ``get_object()`` method
|
|
||||||
with the ``bits`` argument to specify a specific category to show. In
|
|
||||||
the new :class:`~django.contrib.syndication.views.Feed` class,
|
|
||||||
``get_object()`` method takes a ``request`` and arguments from the
|
|
||||||
URL, so it would look like this::
|
|
||||||
|
|
||||||
from django.contrib.syndication.views import Feed
|
|
||||||
from django.shortcuts import get_object_or_404
|
|
||||||
from myproject.models import Category
|
|
||||||
|
|
||||||
class LatestEntriesByCategory(Feed):
|
|
||||||
def get_object(self, request, category_id):
|
|
||||||
return get_object_or_404(Category, id=category_id)
|
|
||||||
|
|
||||||
# ...
|
|
||||||
|
|
||||||
Additionally, the ``get_feed()`` method on ``Feed`` classes now take
|
|
||||||
different arguments, which may impact you if you use the ``Feed``
|
|
||||||
classes directly. Instead of just taking an optional ``url`` argument,
|
|
||||||
it now takes two arguments: the object returned by its own
|
|
||||||
``get_object()`` method, and the current ``request`` object.
|
|
||||||
|
|
||||||
To take into account ``Feed`` classes not being initialized for each
|
|
||||||
request, the ``__init__()`` method now takes no arguments by default.
|
|
||||||
Previously it would have taken the ``slug`` from the URL and the
|
|
||||||
``request`` object.
|
|
||||||
|
|
||||||
In accordance with `RSS best practices`_, RSS feeds will now include
|
|
||||||
an ``atom:link`` element. You may need to update your tests to take
|
|
||||||
this into account.
|
|
||||||
|
|
||||||
For more information, see the full :ref:`syndication framework
|
For more information, see the full :ref:`syndication framework
|
||||||
documentation <ref-contrib-syndication>`.
|
documentation <ref-contrib-syndication>`.
|
||||||
|
@ -131,12 +67,21 @@ Cookie encoding
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Due to cookie-handling bugs in Internet Explorer, Safari, and possibly
|
Due to cookie-handling bugs in Internet Explorer, Safari, and possibly
|
||||||
other browsers, our encoding of cookie values was changed so that the
|
other browsers, Django's encoding of cookie values was changed so that
|
||||||
characters comma (',') and semi-colon (';') are treated as non-safe
|
the characters comma (',') and semi-colon (';') are treated as
|
||||||
characters, and are therefore encoded as ``\054`` and ``\073``
|
non-safe characters, and are therefore encoded as ``\054`` and
|
||||||
respectively. This could produce backwards incompatibilities if you
|
``\073`` respectively. This could produce backwards incompatibilities
|
||||||
are relying on the ability to set these characters directly in cookie
|
if you are relying on the ability to set these characters directly in
|
||||||
values.
|
cookie values.
|
||||||
|
|
||||||
|
|
||||||
|
What's new in 1.2 beta
|
||||||
|
======================
|
||||||
|
|
||||||
|
This 1.2 beta release marks the final feature freeze for Django 1.2;
|
||||||
|
while most feature development was completed for 1.2 alpha (which
|
||||||
|
constituted a freeze on major features), a few other new features were
|
||||||
|
added afterward and so are new as of 1.2 beta.
|
||||||
|
|
||||||
|
|
||||||
Object-level permissions
|
Object-level permissions
|
||||||
|
@ -163,6 +108,15 @@ is allowed or not to the authorization/authentication system. See the
|
||||||
:ref:`authentication docs <topics-auth>` for more details.
|
:ref:`authentication docs <topics-auth>` for more details.
|
||||||
|
|
||||||
|
|
||||||
|
``select_related()`` improvements
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
The ``select_related()`` method of ``QuerySet`` now accepts the
|
||||||
|
``related_name`` of a reverse one-to-one relation in the list of
|
||||||
|
fields to select. One-to-one relations will not, however, be traversed
|
||||||
|
by a depth-based ``select_related()`` call.
|
||||||
|
|
||||||
|
|
||||||
The Django 1.2 roadmap
|
The Django 1.2 roadmap
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue