mirror / django-trunk (http://djangoproject.com/)
Mirror of the Django trunk.
Clone this repository (size: 29.1 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/mirror/django-trunk/
| commit 7860: | ee29e66564d1 |
| parent 7859: | d5c4ff067f22 |
| branch: | default |
Reorganize the beta release notes a bit and trim down the section on feeds.
6 weeks ago
Changed (Δ1.7 KB):
raw changeset »
docs/releases/1.2-beta-1.txt (61 lines added, 107 lines removed)
Up to file-list docs/releases/1.2-beta-1.txt:
| … | … | @@ -23,6 +23,58 @@ This document covers changes since the D |
23 |
23 |
updated features in Django between 1.1 and 1.2 alpha. |
24 |
24 |
|
25 |
25 |
|
26 |
Deprecations and other changes in 1.2 beta |
|
27 |
========================================== |
|
28 |
||
29 |
This beta release deprecates one portion of public API, and introduces |
|
30 |
a potentially backwards-incompatible change to another. Under `our API |
|
31 |
stability policy <misc-api-stability>`, deprecation proceeds over |
|
32 |
multiple release cycles: initially, the deprecated API will raise |
|
33 |
``PendingDeprecationWarning``, followed by raising |
|
34 |
``DeprecationWarning`` in the following release, and finally removal |
|
35 |
of the deprecated API. APIs beginning the deprecation process in |
|
36 |
Django 1.2 will be removed in the Django 1.4 release. |
|
37 |
||
38 |
||
39 |
Unit test runners |
|
40 |
----------------- |
|
41 |
||
42 |
Django 1.2 changes the test runner tools to use a class-based |
|
43 |
approach. Old style function-based test runners will still work, but |
|
44 |
should be updated to use the new :ref:`class-based runners |
|
45 |
<topics-testing-test_runner>`. |
|
46 |
||
47 |
||
48 |
Syndication feeds |
|
49 |
----------------- |
|
50 |
||
51 |
The :class:`django.contrib.syndication.feeds.Feed` class is being |
|
52 |
replaced by the :class:`django.contrib.syndication.views.Feed` class. |
|
53 |
The old ``feeds.Feed`` class is deprecated. The new class has an |
|
54 |
almost identical API, but allows instances to be used as views. |
|
55 |
||
56 |
Also, in accordance with `RSS best practices`_, RSS feeds will now |
|
57 |
include an ``atom:link`` element. You may need to update your tests to |
|
58 |
take this into account. |
|
59 |
||
60 |
For more information, see the full :ref:`syndication framework |
|
61 |
documentation <ref-contrib-syndication>`. |
|
62 |
||
63 |
.. _RSS best practices: http://www.rssboard.org/rss-profile |
|
64 |
||
65 |
||
66 |
Cookie encoding |
|
67 |
--------------- |
|
68 |
||
69 |
Due to cookie-handling bugs in Internet Explorer, Safari, and possibly |
|
70 |
other browsers, Django's encoding of cookie values was changed so that |
|
71 |
the characters comma (',') and semi-colon (';') are treated as |
|
72 |
non-safe characters, and are therefore encoded as ``\054`` and |
|
73 |
``\073`` respectively. This could produce backwards incompatibilities |
|
74 |
if you are relying on the ability to set these characters directly in |
|
75 |
cookie values. |
|
76 |
||
77 |
||
26 |
78 |
What's new in 1.2 beta |
27 |
79 |
====================== |
28 |
80 |
|
| … | … | @@ -31,113 +83,6 @@ while most feature development was compl |
31 |
83 |
constituted a freeze on major features), a few other new features were |
32 |
84 |
added afterward and so are new as of 1.2 beta. |
33 |
85 |
|
34 |
Additionally, some existing APIs have been deprecated; under `our API |
|
35 |
stability policy <misc-api-stability>`, these APIs will continue to |
|
36 |
work for now, but will raise ``PendingDeprecationWarning`` in Django |
|
37 |
1.2 and ``DeprecationWarning`` in Django 1.3, before being removed in |
|
38 |
Django 1.4. |
|
39 |
||
40 |
||
41 |
Class-based test runners |
|
42 |
------------------------ |
|
43 |
||
44 |
Django 1.2 changes the test runner tools to use a class-based |
|
45 |
approach. Old style function-based test runners will still work, but |
|
46 |
should be updated to use the new :ref:`class-based runners |
|
47 |
<topics-testing-test_runner>`. |
|
48 |
||
49 |
||
50 |
``Feed`` in ``django.contrib.syndication.feeds`` |
|
51 |
------------------------------------------------ |
|
52 |
||
53 |
The :class:`django.contrib.syndication.feeds.Feed` class is being |
|
54 |
replaced by the :class:`django.contrib.syndication.views.Feed` class. |
|
55 |
The old ``feeds.Feed`` class is deprecated, and will be removed in |
|
56 |
Django 1.4. |
|
57 |
||
58 |
The new class has an almost identical API, but allows instances to be |
|
59 |
used as views. For example, consider the use of the old framework in |
|
60 |
the following :ref:`URLconf <topics-http-urls>`:: |
|
61 |
||
62 |
from django.conf.urls.defaults import * |
|
63 |
from myproject.feeds import LatestEntries, LatestEntriesByCategory |
|
64 |
||
65 |
feeds = { |
|
66 |
'latest': LatestEntries, |
|
67 |
'categories': LatestEntriesByCategory, |
|
68 |
} |
|
69 |
||
70 |
urlpatterns = patterns('', |
|
71 |
# ... |
|
72 |
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', |
|
73 |
{'feed_dict': feeds}), |
|
74 |
# ... |
|
75 |
) |
|
76 |
||
77 |
Using the new Feed class, these feeds can be deployed directly as views:: |
|
78 |
||
79 |
from django.conf.urls.defaults import * |
|
80 |
from myproject.feeds import LatestEntries, LatestEntriesByCategory |
|
81 |
||
82 |
urlpatterns = patterns('', |
|
83 |
# ... |
|
84 |
(r'^feeds/latest/$', LatestEntries()), |
|
85 |
(r'^feeds/categories/(?P<category_id>\d+)/$', LatestEntriesByCategory()), |
|
86 |
# ... |
|
87 |
) |
|
88 |
||
89 |
If you currently use the ``feed()`` view, the ``LatestEntries`` class |
|
90 |
would not need to be modified apart from subclassing the new |
|
91 |
:class:`~django.contrib.syndication.views.Feed` class. |
|
92 |
||
93 |
However, ``LatestEntriesByCategory`` uses the ``get_object()`` method |
|
94 |
with the ``bits`` argument to specify a specific category to show. In |
|
95 |
the new :class:`~django.contrib.syndication.views.Feed` class, |
|
96 |
``get_object()`` method takes a ``request`` and arguments from the |
|
97 |
URL, so it would look like this:: |
|
98 |
||
99 |
from django.contrib.syndication.views import Feed |
|
100 |
from django.shortcuts import get_object_or_404 |
|
101 |
from myproject.models import Category |
|
102 |
||
103 |
class LatestEntriesByCategory(Feed): |
|
104 |
def get_object(self, request, category_id): |
|
105 |
return get_object_or_404(Category, id=category_id) |
|
106 |
||
107 |
# ... |
|
108 |
||
109 |
Additionally, the ``get_feed()`` method on ``Feed`` classes now take |
|
110 |
different arguments, which may impact you if you use the ``Feed`` |
|
111 |
classes directly. Instead of just taking an optional ``url`` argument, |
|
112 |
it now takes two arguments: the object returned by its own |
|
113 |
``get_object()`` method, and the current ``request`` object. |
|
114 |
||
115 |
To take into account ``Feed`` classes not being initialized for each |
|
116 |
request, the ``__init__()`` method now takes no arguments by default. |
|
117 |
Previously it would have taken the ``slug`` from the URL and the |
|
118 |
``request`` object. |
|
119 |
||
120 |
In accordance with `RSS best practices`_, RSS feeds will now include |
|
121 |
an ``atom:link`` element. You may need to update your tests to take |
|
122 |
this into account. |
|
123 |
||
124 |
For more information, see the full :ref:`syndication framework |
|
125 |
documentation <ref-contrib-syndication>`. |
|
126 |
||
127 |
.. _RSS best practices: http://www.rssboard.org/rss-profile |
|
128 |
||
129 |
||
130 |
Cookie encoding |
|
131 |
--------------- |
|
132 |
||
133 |
Due to cookie-handling bugs in Internet Explorer, Safari, and possibly |
|
134 |
other browsers, our encoding of cookie values was changed so that the |
|
135 |
characters comma (',') and semi-colon (';') are treated as non-safe |
|
136 |
characters, and are therefore encoded as ``\054`` and ``\073`` |
|
137 |
respectively. This could produce backwards incompatibilities if you |
|
138 |
are relying on the ability to set these characters directly in cookie |
|
139 |
values. |
|
140 |
||
141 |
86 |
|
142 |
87 |
Object-level permissions |
143 |
88 |
------------------------ |
| … | … | @@ -163,6 +108,15 @@ is allowed or not to the authorization/a |
163 |
108 |
:ref:`authentication docs <topics-auth>` for more details. |
164 |
109 |
|
165 |
110 |
|
111 |
``select_related()`` improvements |
|
112 |
--------------------------------- |
|
113 |
||
114 |
The ``select_related()`` method of ``QuerySet`` now accepts the |
|
115 |
``related_name`` of a reverse one-to-one relation in the list of |
|
116 |
fields to select. One-to-one relations will not, however, be traversed |
|
117 |
by a depth-based ``select_related()`` call. |
|
118 |
||
119 |
||
166 |
120 |
The Django 1.2 roadmap |
167 |
121 |
====================== |
168 |
122 |
