Sophie

Sophie

distrib > Arklinux > devel > i586 > media > main > by-pkgid > 5fcb1fedf34660bc240dc59b7bfcebc4 > files > 421

django-doc-1.2.3-1ark.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Django 1.1 release notes &mdash; Django v1.2 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Django v1.2 documentation" href="../index.html" />
    <link rel="up" title="Release notes" href="index.html" />
    <link rel="next" title="Django 1.0.2 release notes" href="1.0.2.html" />
    <link rel="prev" title="Django 1.1.2 release notes" href="1.1.2.html" />
 
<script type="text/javascript" src="../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>

  </head>
  <body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django v1.2 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="1.1.2.html" title="Django 1.1.2 release notes">previous</a> 
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="1.0.2.html" title="Django 1.0.2 release notes">next</a> &raquo;</div>
    </div>
    
    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="releases-1.1">
            
  <div class="section" id="s-django-1-1-release-notes">
<span id="django-1-1-release-notes"></span><h1>Django 1.1 release notes<a class="headerlink" href="#django-1-1-release-notes" title="Permalink to this headline">¶</a></h1>
<p>July 29, 2009</p>
<p>Welcome to Django 1.1!</p>
<p>Django 1.1 includes a number of nifty <a class="reference internal" href="#what-s-new-in-django-1-1">new features</a>, lots of bug
fixes, and an easy upgrade path from Django 1.0.</p>
<div class="section" id="s-backwards-incompatible-changes-in-1-1">
<span id="s-backwards-incompatible-changes-1-1"></span><span id="backwards-incompatible-changes-in-1-1"></span><span id="backwards-incompatible-changes-1-1"></span><h2>Backwards-incompatible changes in 1.1<a class="headerlink" href="#backwards-incompatible-changes-in-1-1" title="Permalink to this headline">¶</a></h2>
<p>Django has a policy of <a class="reference internal" href="../misc/api-stability.html"><em>API stability</em></a>. This means
that, in general, code you develop against Django 1.0 should continue to work
against 1.1 unchanged. However, we do sometimes make backwards-incompatible
changes if they&#8217;re necessary to resolve bugs, and there are a handful of such
(minor) changes between Django 1.0 and Django 1.1.</p>
<p>Before upgrading to Django 1.1 you should double-check that the following
changes don&#8217;t impact you, and upgrade your code if they do.</p>
<div class="section" id="s-changes-to-constraint-names">
<span id="changes-to-constraint-names"></span><h3>Changes to constraint names<a class="headerlink" href="#changes-to-constraint-names" title="Permalink to this headline">¶</a></h3>
<p>Django 1.1 modifies the method used to generate database constraint names so
that names are consistent regardless of machine word size. This change is
backwards incompatible for some users.</p>
<p>If you are using a 32-bit platform, you&#8217;re off the hook; you&#8217;ll observe no
differences as a result of this change.</p>
<p>However, <strong>users on 64-bit platforms may experience some problems</strong> using the
<a class="reference internal" href="../ref/django-admin.html#django-admin-reset"><tt class="xref std std-djadmin docutils literal"><span class="pre">reset</span></tt></a> management command. Prior to this change, 64-bit platforms
would generate a 64-bit, 16 character digest in the constraint name; for
example:</p>
<div class="highlight-python"><pre>ALTER TABLE myapp_sometable ADD CONSTRAINT object_id_refs_id_5e8f10c132091d1e FOREIGN KEY ...</pre>
</div>
<p>Following this change, all platforms, regardless of word size, will generate a
32-bit, 8 character digest in the constraint name; for example:</p>
<div class="highlight-python"><pre>ALTER TABLE myapp_sometable ADD CONSTRAINT object_id_refs_id_32091d1e FOREIGN KEY ...</pre>
</div>
<p>As a result of this change, you will not be able to use the <a class="reference internal" href="../ref/django-admin.html#django-admin-reset"><tt class="xref std std-djadmin docutils literal"><span class="pre">reset</span></tt></a>
management command on any table made by a 64-bit machine. This is because the
the new generated name will not match the historically generated name; as a
result, the SQL constructed by the reset command will be invalid.</p>
<p>If you need to reset an application that was created with 64-bit constraints,
you will need to manually drop the old constraint prior to invoking
<a class="reference internal" href="../ref/django-admin.html#django-admin-reset"><tt class="xref std std-djadmin docutils literal"><span class="pre">reset</span></tt></a>.</p>
</div>
<div class="section" id="s-test-cases-are-now-run-in-a-transaction">
<span id="test-cases-are-now-run-in-a-transaction"></span><h3>Test cases are now run in a transaction<a class="headerlink" href="#test-cases-are-now-run-in-a-transaction" title="Permalink to this headline">¶</a></h3>
<p>Django 1.1 runs tests inside a transaction, allowing better test performance
(see <a class="reference internal" href="#test-performance-improvements">test performance improvements</a> for details).</p>
<p>This change is slightly backwards incompatible if existing tests need to test
transactional behavior, if they rely on invalid assumptions about the test
environment, or if they require a specific test case ordering.</p>
<p>For these cases, <a class="reference internal" href="../topics/testing.html#django.test.TransactionTestCase" title="django.test.TransactionTestCase"><tt class="xref py py-class docutils literal"><span class="pre">TransactionTestCase</span></tt></a> can be used instead.
This is a just a quick fix to get around test case errors revealed by the new
rollback approach; in the long-term tests should be rewritten to correct the
test case.</p>
</div>
<div class="section" id="s-removed-setremoteaddrfromforwardedfor-middleware">
<span id="s-id1"></span><span id="removed-setremoteaddrfromforwardedfor-middleware"></span><span id="id1"></span><h3>Removed <tt class="docutils literal"><span class="pre">SetRemoteAddrFromForwardedFor</span></tt> middleware<a class="headerlink" href="#removed-setremoteaddrfromforwardedfor-middleware" title="Permalink to this headline">¶</a></h3>
<p>For convenience, Django 1.0 included an optional middleware class --
<tt class="docutils literal"><span class="pre">django.middleware.http.SetRemoteAddrFromForwardedFor</span></tt> -- which updated the
value of <tt class="docutils literal"><span class="pre">REMOTE_ADDR</span></tt> based on the HTTP <tt class="docutils literal"><span class="pre">X-Forwarded-For</span></tt> header commonly
set by some proxy configurations.</p>
<p>It has been demonstrated that this mechanism cannot be made reliable enough for
general-purpose use, and that (despite documentation to the contrary) its
inclusion in Django may lead application developers to assume that the value of
<tt class="docutils literal"><span class="pre">REMOTE_ADDR</span></tt> is &quot;safe&quot; or in some way reliable as a source of authentication.</p>
<p>While not directly a security issue, we've decided to remove this middleware
with the Django 1.1 release. It has been replaced with a class that does nothing
other than raise a <tt class="docutils literal"><span class="pre">DeprecationWarning</span></tt>.</p>
<p>If you've been relying on this middleware, the easiest upgrade path is:</p>
<ul class="simple">
<li>Examine <a class="reference external" href="http://code.djangoproject.com/browser/django/trunk/django/middleware/http.py?rev=11000#L33">the code as it existed before it was removed</a>.</li>
<li>Verify that it works correctly with your upstream proxy, modifying
it to support your particular proxy (if necessary).</li>
<li>Introduce your modified version of <tt class="docutils literal"><span class="pre">SetRemoteAddrFromForwardedFor</span></tt> as a
piece of middleware in your own project.</li>
</ul>
</div>
<div class="section" id="s-names-of-uploaded-files-are-available-later">
<span id="names-of-uploaded-files-are-available-later"></span><h3>Names of uploaded files are available later<a class="headerlink" href="#names-of-uploaded-files-are-available-later" title="Permalink to this headline">¶</a></h3>
<p>In Django 1.0, files uploaded and stored in a model's <a class="reference internal" href="../ref/models/fields.html#django.db.models.FileField" title="django.db.models.FileField"><tt class="xref py py-class docutils literal"><span class="pre">FileField</span></tt></a> were
saved to disk before the model was saved to the database. This meant that the
actual file name assigned to the file was available before saving. For example,
it was available in a model's pre-save signal handler.</p>
<p>In Django 1.1 the file is saved as part of saving the model in the database, so
the actual file name used on disk cannot be relied on until <em>after</em> the model
has been saved.</p>
</div>
<div class="section" id="s-changes-to-how-model-formsets-are-saved">
<span id="changes-to-how-model-formsets-are-saved"></span><h3>Changes to how model formsets are saved<a class="headerlink" href="#changes-to-how-model-formsets-are-saved" title="Permalink to this headline">¶</a></h3>
<p>In Django 1.1, <tt class="xref py py-class docutils literal"><span class="pre">BaseModelFormSet</span></tt> now calls <tt class="xref py py-meth docutils literal"><span class="pre">ModelForm.save()</span></tt>.</p>
<p>This is backwards-incompatible if you were modifying <tt class="docutils literal"><span class="pre">self.initial</span></tt> in a model
formset's <tt class="docutils literal"><span class="pre">__init__</span></tt>, or if you relied on the internal <tt class="docutils literal"><span class="pre">_total_form_count</span></tt>
or <tt class="docutils literal"><span class="pre">_initial_form_count</span></tt> attributes of BaseFormSet. Those attributes are now
public methods.</p>
</div>
<div class="section" id="s-fixed-the-join-filter-s-escaping-behavior">
<span id="fixed-the-join-filter-s-escaping-behavior"></span><h3>Fixed the <tt class="docutils literal"><span class="pre">join</span></tt> filter's escaping behavior<a class="headerlink" href="#fixed-the-join-filter-s-escaping-behavior" title="Permalink to this headline">¶</a></h3>
<p>The <tt class="xref std std-ttag docutils literal"><span class="pre">join</span></tt> filter no longer escapes the literal value that is
passed in for the connector.</p>
<p>This is backwards incompatible for the special situation of the literal string
containing one of the five special HTML characters. Thus, if you were writing
<tt class="docutils literal"><span class="pre">{{</span> <span class="pre">foo|join:&quot;&amp;&quot;</span> <span class="pre">}}</span></tt>, you now have to write <tt class="docutils literal"><span class="pre">{{</span> <span class="pre">foo|join:&quot;&amp;amp;&quot;</span> <span class="pre">}}</span></tt>.</p>
<p>The previous behavior was a bug and contrary to what was documented
and expected.</p>
</div>
<div class="section" id="s-permanent-redirects-and-the-redirect-to-generic-view">
<span id="permanent-redirects-and-the-redirect-to-generic-view"></span><h3>Permanent redirects and the <tt class="docutils literal"><span class="pre">redirect_to()</span></tt> generic view<a class="headerlink" href="#permanent-redirects-and-the-redirect-to-generic-view" title="Permalink to this headline">¶</a></h3>
<p>Django 1.1 adds a <tt class="docutils literal"><span class="pre">permanent</span></tt> argument to the
<tt class="xref py py-func docutils literal"><span class="pre">django.views.generic.simple.redirect_to()</span></tt> view. This is technically
backwards-incompatible if you were using the <tt class="docutils literal"><span class="pre">redirect_to</span></tt> view with a
format-string key called 'permanent', which is highly unlikely.</p>
</div>
</div>
<div class="section" id="s-features-deprecated-in-1-1">
<span id="s-deprecated-features-1-1"></span><span id="features-deprecated-in-1-1"></span><span id="deprecated-features-1-1"></span><h2>Features deprecated in 1.1<a class="headerlink" href="#features-deprecated-in-1-1" title="Permalink to this headline">¶</a></h2>
<p>One feature has been marked as deprecated in Django 1.1:</p>
<ul>
<li><p class="first">You should no longer use <tt class="docutils literal"><span class="pre">AdminSite.root()</span></tt> to register that admin
views. That is, if your URLconf contains the line:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">(</span><span class="s">r&#39;^admin/(.*)&#39;</span><span class="p">,</span> <span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">root</span><span class="p">),</span>
</pre></div>
</div>
<p>You should change it to read:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">(</span><span class="s">r&#39;^admin/&#39;</span><span class="p">,</span> <span class="n">include</span><span class="p">(</span><span class="n">admin</span><span class="o">.</span><span class="n">site</span><span class="o">.</span><span class="n">urls</span><span class="p">)),</span>
</pre></div>
</div>
</li>
</ul>
<p>You should begin to remove use of this feature from your code immediately.</p>
<p><tt class="docutils literal"><span class="pre">AdminSite.root</span></tt> will raise a <tt class="docutils literal"><span class="pre">PendingDeprecationWarning</span></tt> if used in
Django 1.1. This warning is hidden by default. In Django 1.2, this warning will
be upgraded to a <tt class="docutils literal"><span class="pre">DeprecationWarning</span></tt>, which will be displayed loudly. Django
1.3 will remove <tt class="docutils literal"><span class="pre">AdminSite.root()</span></tt> entirely.</p>
<p>For more details on our deprecation policies and strategy, see
<a class="reference internal" href="../internals/release-process.html"><em>Django's release process</em></a>.</p>
</div>
<div class="section" id="s-what-s-new-in-django-1-1">
<span id="what-s-new-in-django-1-1"></span><h2>What's new in Django 1.1<a class="headerlink" href="#what-s-new-in-django-1-1" title="Permalink to this headline">¶</a></h2>
<p>Quite a bit: since Django 1.0, we've made 1,290 code commits, fixed 1,206 bugs,
and added roughly 10,000 lines of documentation.</p>
<p>The major new features in Django 1.1 are:</p>
<div class="section" id="s-orm-improvements">
<span id="orm-improvements"></span><h3>ORM improvements<a class="headerlink" href="#orm-improvements" title="Permalink to this headline">¶</a></h3>
<p>Two major enhancements have been added to Django's object-relational mapper
(ORM): aggregate support, and query expressions.</p>
<div class="section" id="s-aggregate-support">
<span id="aggregate-support"></span><h4>Aggregate support<a class="headerlink" href="#aggregate-support" title="Permalink to this headline">¶</a></h4>
<p>It's now possible to run SQL aggregate queries (i.e. <tt class="docutils literal"><span class="pre">COUNT()</span></tt>, <tt class="docutils literal"><span class="pre">MAX()</span></tt>,
<tt class="docutils literal"><span class="pre">MIN()</span></tt>, etc.) from within Django's ORM. You can choose to either return the
results of the aggregate directly, or else annotate the objects in a
<tt class="xref py py-class docutils literal"><span class="pre">QuerySet</span></tt> with the results of the aggregate query.</p>
<p>This feature is available as new <tt class="xref py py-meth docutils literal"><span class="pre">QuerySet.aggregate()`()</span></tt> and
<tt class="xref py py-meth docutils literal"><span class="pre">QuerySet.annotate()`()</span></tt> methods, and is covered in detail in <a class="reference internal" href="../topics/db/aggregation.html"><em>the ORM
aggregation documentation</em></a>.</p>
</div>
<div class="section" id="s-query-expressions">
<span id="query-expressions"></span><h4>Query expressions<a class="headerlink" href="#query-expressions" title="Permalink to this headline">¶</a></h4>
<p>Queries can now refer to a another field on the query and can traverse
relationships to refer to fields on related models. This is implemented in the
new <tt class="xref py py-class docutils literal"><span class="pre">F</span></tt> object; for full details, including examples, consult the
<a class="reference internal" href="../topics/db/queries.html#query-expressions"><em>documentation for F expressions</em></a>.</p>
</div>
</div>
<div class="section" id="s-model-improvements">
<span id="model-improvements"></span><h3>Model improvements<a class="headerlink" href="#model-improvements" title="Permalink to this headline">¶</a></h3>
<p>A number of features have been added to Django's model layer:</p>
<div class="section" id="s-unmanaged-models">
<span id="unmanaged-models"></span><h4>&quot;Unmanaged&quot; models<a class="headerlink" href="#unmanaged-models" title="Permalink to this headline">¶</a></h4>
<p>You can now control whether or not Django manages the life-cycle of the database
tables for a model using the <a class="reference internal" href="../ref/models/options.html#django.db.models.Options.managed" title="django.db.models.Options.managed"><tt class="xref py py-attr docutils literal"><span class="pre">managed</span></tt></a> model option. This
defaults to <tt class="xref docutils literal"><span class="pre">True</span></tt>, meaning that Django will create the appropriate database
tables in <a class="reference internal" href="../ref/django-admin.html#django-admin-syncdb"><tt class="xref std std-djadmin docutils literal"><span class="pre">syncdb</span></tt></a> and remove them as part of the <a class="reference internal" href="../ref/django-admin.html#django-admin-reset"><tt class="xref std std-djadmin docutils literal"><span class="pre">reset</span></tt></a>
command. That is, Django <em>manages</em> the database table's lifecycle.</p>
<p>If you set this to <tt class="xref docutils literal"><span class="pre">False</span></tt>, however, no database table creating or deletion
will be automatically performed for this model. This is useful if the model
represents an existing table or a database view that has been created by some
other means.</p>
<p>For more details, see the documentation for the <a class="reference internal" href="../ref/models/options.html#django.db.models.Options.managed" title="django.db.models.Options.managed"><tt class="xref py py-attr docutils literal"><span class="pre">managed</span></tt></a>
option.</p>
</div>
<div class="section" id="s-proxy-models">
<span id="proxy-models"></span><h4>Proxy models<a class="headerlink" href="#proxy-models" title="Permalink to this headline">¶</a></h4>
<p>You can now create <a class="reference internal" href="../topics/db/models.html#proxy-models"><em>proxy models</em></a>: subclasses of existing
models that only add Python-level (rather than database-level) behavior and
aren't represented by a new table. That is, the new model is a <em>proxy</em> for some
underlying model, which stores all the real data.</p>
<p>All the details can be found in the <a class="reference internal" href="../topics/db/models.html#proxy-models"><em>proxy models documentation</em></a>. This feature is similar on the surface to unmanaged models,
so the documentation has an explanation of <a class="reference internal" href="../topics/db/models.html#proxy-vs-unmanaged-models"><em>how proxy models differ from
unmanaged models</em></a>.</p>
</div>
<div class="section" id="s-deferred-fields">
<span id="deferred-fields"></span><h4>Deferred fields<a class="headerlink" href="#deferred-fields" title="Permalink to this headline">¶</a></h4>
<p>In some complex situations, your models might contain fields which could
contain a lot of data (for example, large text fields), or require expensive
processing to convert them to Python objects. If you know you don't need those
particular fields, you can now tell Django not to retrieve them from the
database.</p>
<p>You'll do this with the new queryset methods
<a class="reference internal" href="../ref/models/querysets.html#django.db.models.QuerySet.defer" title="django.db.models.QuerySet.defer"><tt class="xref py py-meth docutils literal"><span class="pre">defer()</span></tt></a> and
<a class="reference internal" href="../ref/models/querysets.html#django.db.models.QuerySet.only" title="django.db.models.QuerySet.only"><tt class="xref py py-meth docutils literal"><span class="pre">only()</span></tt></a>.</p>
</div>
</div>
<div class="section" id="s-testing-improvements">
<span id="testing-improvements"></span><h3>Testing improvements<a class="headerlink" href="#testing-improvements" title="Permalink to this headline">¶</a></h3>
<p>A few notable improvements have been made to the <a class="reference internal" href="../topics/testing.html"><em>testing framework</em></a>.</p>
<div class="section" id="s-test-performance-improvements">
<span id="test-performance-improvements"></span><h4>Test performance improvements<a class="headerlink" href="#test-performance-improvements" title="Permalink to this headline">¶</a></h4>
<p>Tests written using Django's <a class="reference internal" href="../topics/testing.html"><em>testing framework</em></a> now run
dramatically faster (as much as 10 times faster in many cases).</p>
<p>This was accomplished through the introduction of transaction-based tests: when
using <a class="reference internal" href="../topics/testing.html#django.test.TestCase" title="django.test.TestCase"><tt class="xref py py-class docutils literal"><span class="pre">django.test.TestCase</span></tt></a>, your tests will now be run in a transaction
which is rolled back when finished, instead of by flushing and re-populating the
database. This results in an immense speedup for most types of unit tests. See
the documentation for <a class="reference internal" href="../topics/testing.html#django.test.TestCase" title="django.test.TestCase"><tt class="xref py py-class docutils literal"><span class="pre">TestCase</span></tt></a> and <a class="reference internal" href="../topics/testing.html#django.test.TransactionTestCase" title="django.test.TransactionTestCase"><tt class="xref py py-class docutils literal"><span class="pre">TransactionTestCase</span></tt></a> for a
full description, and some important notes on database support.</p>
</div>
</div>
<div class="section" id="s-test-client-improvements">
<span id="test-client-improvements"></span><h3>Test client improvements<a class="headerlink" href="#test-client-improvements" title="Permalink to this headline">¶</a></h3>
<p>A couple of small -- but highly useful -- improvements have been made to the
test client:</p>
<ul class="simple">
<li>The test <a class="reference internal" href="../topics/testing.html#django.test.client.Client" title="django.test.client.Client"><tt class="xref py py-class docutils literal"><span class="pre">Client</span></tt></a> now can automatically follow redirects with the
<tt class="docutils literal"><span class="pre">follow</span></tt> argument to <a class="reference internal" href="../topics/testing.html#django.test.client.Client.get" title="django.test.client.Client.get"><tt class="xref py py-meth docutils literal"><span class="pre">Client.get()</span></tt></a> and <a class="reference internal" href="../topics/testing.html#django.test.client.Client.post" title="django.test.client.Client.post"><tt class="xref py py-meth docutils literal"><span class="pre">Client.post()</span></tt></a>. This
makes testing views that issue redirects simpler.</li>
<li>It's now easier to get at the template context in the response returned
the test client: you'll simply access the context as
<tt class="docutils literal"><span class="pre">request.context[key]</span></tt>. The old way, which treats <tt class="docutils literal"><span class="pre">request.context</span></tt> as
a list of contexts, one for each rendered template in the inheritance
chain, is still available if you need it.</li>
</ul>
</div>
<div class="section" id="s-new-admin-features">
<span id="new-admin-features"></span><h3>New admin features<a class="headerlink" href="#new-admin-features" title="Permalink to this headline">¶</a></h3>
<p>Django 1.1 adds a couple of nifty new features to Django's admin interface:</p>
<div class="section" id="s-editable-fields-on-the-change-list">
<span id="editable-fields-on-the-change-list"></span><h4>Editable fields on the change list<a class="headerlink" href="#editable-fields-on-the-change-list" title="Permalink to this headline">¶</a></h4>
<p>You can now make fields editable on the admin list views via the new
<a class="reference internal" href="../ref/contrib/admin/index.html#admin-list-editable"><em>list_editable</em></a> admin option. These fields will show
up as form widgets on the list pages, and can be edited and saved in bulk.</p>
</div>
<div class="section" id="s-admin-actions">
<span id="admin-actions"></span><h4>Admin &quot;actions&quot;<a class="headerlink" href="#admin-actions" title="Permalink to this headline">¶</a></h4>
<p>You can now define <a class="reference internal" href="../ref/contrib/admin/actions.html"><em>admin actions</em></a> that can
perform some action to a group of models in bulk. Users will be able to select
objects on the change list page and then apply these bulk actions to all
selected objects.</p>
<p>Django ships with one pre-defined admin action to delete a group of objects in
one fell swoop.</p>
</div>
</div>
<div class="section" id="s-conditional-view-processing">
<span id="conditional-view-processing"></span><h3>Conditional view processing<a class="headerlink" href="#conditional-view-processing" title="Permalink to this headline">¶</a></h3>
<p>Django now has much better support for <a class="reference internal" href="../topics/conditional-view-processing.html"><em>conditional view processing</em></a> using the standard <tt class="docutils literal"><span class="pre">ETag</span></tt> and
<tt class="docutils literal"><span class="pre">Last-Modified</span></tt> HTTP headers. This means you can now easily short-circuit
view processing by testing less-expensive conditions. For many views this can
lead to a serious improvement in speed and reduction in bandwidth.</p>
</div>
<div class="section" id="s-url-namespaces">
<span id="url-namespaces"></span><h3>URL namespaces<a class="headerlink" href="#url-namespaces" title="Permalink to this headline">¶</a></h3>
<p>Django 1.1 improves <a class="reference internal" href="../topics/http/urls.html#naming-url-patterns"><em>named URL patterns</em></a> with the
introduction of URL &quot;namespaces.&quot;</p>
<p>In short, this feature allows the same group of URLs, from the same application,
to be included in a Django URLConf multiple times, with varying (and potentially
nested) named prefixes which will be used when performing reverse resolution. In
other words, reusable applications like Django's admin interface may be
registered multiple times without URL conflicts.</p>
<p>For full details, see <a class="reference internal" href="../topics/http/urls.html#topics-http-defining-url-namespaces"><em>the documentation on defining URL namespaces</em></a>.</p>
</div>
<div class="section" id="s-geodjango">
<span id="geodjango"></span><h3>GeoDjango<a class="headerlink" href="#geodjango" title="Permalink to this headline">¶</a></h3>
<p>In Django 1.1, <a class="reference external" href="http://geodjango.org/">GeoDjango</a> (i.e. <tt class="docutils literal"><span class="pre">django.contrib.gis</span></tt>) has several new
features:</p>
<ul class="simple">
<li>Support for <a class="reference external" href="http://www.gaia-gis.it/spatialite/">SpatiaLite</a> -- a spatial database for SQLite -- as a spatial
backend.</li>
<li>Geographic aggregates (<tt class="docutils literal"><span class="pre">Collect</span></tt>, <tt class="docutils literal"><span class="pre">Extent</span></tt>, <tt class="docutils literal"><span class="pre">MakeLine</span></tt>, <tt class="docutils literal"><span class="pre">Union</span></tt>)
and <tt class="docutils literal"><span class="pre">F</span></tt> expressions.</li>
<li>New <tt class="docutils literal"><span class="pre">GeoQuerySet</span></tt> methods: <tt class="docutils literal"><span class="pre">collect</span></tt>, <tt class="docutils literal"><span class="pre">geojson</span></tt>, and
<tt class="docutils literal"><span class="pre">snap_to_grid</span></tt>.</li>
<li>A new list interface methods for <tt class="docutils literal"><span class="pre">GEOSGeometry</span></tt> objects.</li>
</ul>
<p>For more details, see the <a class="reference external" href="http://geodjango.org/docs/">GeoDjango documentation</a>.</p>
</div>
<div class="section" id="s-other-improvements">
<span id="other-improvements"></span><h3>Other improvements<a class="headerlink" href="#other-improvements" title="Permalink to this headline">¶</a></h3>
<p>Other new features and changes introduced since Django 1.0 include:</p>
<ul class="simple">
<li>The <a class="reference internal" href="../ref/contrib/csrf.html"><em>CSRF protection middleware</em></a> has been split into
two classes -- <tt class="docutils literal"><span class="pre">CsrfViewMiddleware</span></tt> checks incoming requests, and
<tt class="docutils literal"><span class="pre">CsrfResponseMiddleware</span></tt> processes outgoing responses. The combined
<tt class="docutils literal"><span class="pre">CsrfMiddleware</span></tt> class (which does both) remains for
backwards-compatibility, but using the split classes is now recommended in
order to allow fine-grained control of when and where the CSRF processing
takes place.</li>
<li><a class="reference internal" href="../topics/http/urls.html#django.core.urlresolvers.reverse" title="django.core.urlresolvers.reverse"><tt class="xref py py-func docutils literal"><span class="pre">reverse()</span></tt></a> and code which uses it (e.g., the
<tt class="docutils literal"><span class="pre">{%</span> <span class="pre">url</span> <span class="pre">%}</span></tt> template tag) now works with URLs in Django's administrative
site, provided that the admin URLs are set up via <tt class="docutils literal"><span class="pre">include(admin.site.urls)</span></tt>
(sending admin requests to the <tt class="docutils literal"><span class="pre">admin.site.root</span></tt> view still works, but URLs
in the admin will not be &quot;reversible&quot; when configured this way).</li>
<li>The <tt class="docutils literal"><span class="pre">include()</span></tt> function in Django URLconf modules can now accept sequences
of URL patterns (generated by <tt class="docutils literal"><span class="pre">patterns()</span></tt>) in addition to module names.</li>
<li>Instances of Django forms (see <a class="reference internal" href="../topics/forms/index.html"><em>the forms overview</em></a>)
now have two additional methods, <tt class="docutils literal"><span class="pre">hidden_fields()</span></tt> and <tt class="docutils literal"><span class="pre">visible_fields()</span></tt>,
which return the list of hidden -- i.e., <tt class="docutils literal"><span class="pre">&lt;input</span> <span class="pre">type=&quot;hidden&quot;&gt;</span></tt> -- and
visible fields on the form, respectively.</li>
<li>The <tt class="docutils literal"><span class="pre">redirect_to</span></tt> generic view (see <a class="reference internal" href="../ref/generic-views.html"><em>the generic views documentation</em></a>) now accepts an additional keyword argument
<tt class="docutils literal"><span class="pre">permanent</span></tt>. If <tt class="docutils literal"><span class="pre">permanent</span></tt> is <tt class="xref docutils literal"><span class="pre">True</span></tt>, the view will emit an HTTP
permanent redirect (status code 301). If <tt class="xref docutils literal"><span class="pre">False</span></tt>, the view will emit an HTTP
temporary redirect (status code 302).</li>
<li>A new database lookup type -- <tt class="docutils literal"><span class="pre">week_day</span></tt> -- has been added for <tt class="docutils literal"><span class="pre">DateField</span></tt>
and <tt class="docutils literal"><span class="pre">DateTimeField</span></tt>. This type of lookup accepts a number between 1 (Sunday)
and 7 (Saturday), and returns objects where the field value matches that day
of the week. See <a class="reference internal" href="../ref/models/querysets.html#field-lookups"><em>the full list of lookup types</em></a> for
details.</li>
<li>The <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">for</span> <span class="pre">%}</span></tt> tag in Django's template language now accepts an optional
<tt class="docutils literal"><span class="pre">{%</span> <span class="pre">empty</span> <span class="pre">%}</span></tt> clause, to be displayed when <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">for</span> <span class="pre">%}</span></tt> is asked to loop
over an empty sequence. See <a class="reference internal" href="../ref/templates/builtins.html"><em>the list of built-in template tags</em></a> for examples of this.</li>
<li>The <a class="reference internal" href="../ref/django-admin.html#django-admin-dumpdata"><tt class="xref std std-djadmin docutils literal"><span class="pre">dumpdata</span></tt></a> management command now accepts individual
model names as arguments, allowing you to export the data just from
particular models.</li>
<li>There's a new <a class="reference internal" href="../ref/templates/builtins.html#std:templatefilter-safeseq"><tt class="xref std std-tfilter docutils literal"><span class="pre">safeseq</span></tt></a> template filter which works just like
<a class="reference internal" href="../ref/templates/builtins.html#std:templatefilter-safe"><tt class="xref std std-tfilter docutils literal"><span class="pre">safe</span></tt></a> for lists, marking each item in the list as safe.</li>
<li><a class="reference internal" href="../topics/cache.html"><em>Cache backends</em></a> now support <tt class="docutils literal"><span class="pre">incr()</span></tt> and
<tt class="docutils literal"><span class="pre">decr()</span></tt> commands to increment and decrement the value of a cache key.
On cache backends that support atomic increment/decrement -- most
notably, the memcached backend -- these operations will be atomic, and
quite fast.</li>
<li>Django now can <a class="reference internal" href="../howto/auth-remote-user.html"><em>easily delegate authentication to the web server</em></a> via a new authentication backend that supports
the standard <tt class="docutils literal"><span class="pre">REMOTE_USER</span></tt> environment variable used for this purpose.</li>
<li>There's a new <a class="reference internal" href="../topics/http/shortcuts.html#django.shortcuts.redirect" title="django.shortcuts.redirect"><tt class="xref py py-func docutils literal"><span class="pre">django.shortcuts.redirect()</span></tt></a> function that makes it
easier to issue redirects given an object, a view name, or a URL.</li>
<li>The <tt class="docutils literal"><span class="pre">postgresql_psycopg2</span></tt> backend now supports <a class="reference internal" href="../ref/databases.html#postgresql-notes"><em>native PostgreSQL
autocommit</em></a>. This is an advanced, PostgreSQL-specific
feature, that can make certain read-heavy applications a good deal
faster.</li>
</ul>
</div>
</div>
<div class="section" id="s-what-s-next">
<span id="what-s-next"></span><h2>What's next?<a class="headerlink" href="#what-s-next" title="Permalink to this headline">¶</a></h2>
<p>We'll take a short break, and then work on Django 1.2 will begin -- no rest for
the weary! If you'd like to help, discussion of Django development, including
progress toward the 1.2 release, takes place daily on the django-developers
mailing list:</p>
<ul class="simple">
<li><a class="reference external" href="http://groups.google.com/group/django-developers">http://groups.google.com/group/django-developers</a></li>
</ul>
<p>... and in the <tt class="docutils literal"><span class="pre">#django-dev</span></tt> IRC channel on <tt class="docutils literal"><span class="pre">irc.freenode.net</span></tt>. Feel free to
join the discussions!</p>
<p>Django's online documentation also includes pointers on how to contribute to
Django:</p>
<ul class="simple">
<li><a class="reference internal" href="../internals/contributing.html"><em>How to contribute to Django</em></a></li>
</ul>
<p>Contributions on any level -- developing code, writing documentation or simply
triaging tickets and helping to test proposed bugfixes -- are always welcome and
appreciated.</p>
<p>And that's the way it is.</p>
</div>
</div>


          </div>         
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Django 1.1 release notes</a><ul>
<li><a class="reference internal" href="#backwards-incompatible-changes-in-1-1">Backwards-incompatible changes in 1.1</a><ul>
<li><a class="reference internal" href="#changes-to-constraint-names">Changes to constraint names</a></li>
<li><a class="reference internal" href="#test-cases-are-now-run-in-a-transaction">Test cases are now run in a transaction</a></li>
<li><a class="reference internal" href="#removed-setremoteaddrfromforwardedfor-middleware">Removed <tt class="docutils literal"><span class="pre">SetRemoteAddrFromForwardedFor</span></tt> middleware</a></li>
<li><a class="reference internal" href="#names-of-uploaded-files-are-available-later">Names of uploaded files are available later</a></li>
<li><a class="reference internal" href="#changes-to-how-model-formsets-are-saved">Changes to how model formsets are saved</a></li>
<li><a class="reference internal" href="#fixed-the-join-filter-s-escaping-behavior">Fixed the <tt class="docutils literal"><span class="pre">join</span></tt> filter&#8217;s escaping behavior</a></li>
<li><a class="reference internal" href="#permanent-redirects-and-the-redirect-to-generic-view">Permanent redirects and the <tt class="docutils literal"><span class="pre">redirect_to()</span></tt> generic view</a></li>
</ul>
</li>
<li><a class="reference internal" href="#features-deprecated-in-1-1">Features deprecated in 1.1</a></li>
<li><a class="reference internal" href="#what-s-new-in-django-1-1">What&#8217;s new in Django 1.1</a><ul>
<li><a class="reference internal" href="#orm-improvements">ORM improvements</a><ul>
<li><a class="reference internal" href="#aggregate-support">Aggregate support</a></li>
<li><a class="reference internal" href="#query-expressions">Query expressions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#model-improvements">Model improvements</a><ul>
<li><a class="reference internal" href="#unmanaged-models">&#8220;Unmanaged&#8221; models</a></li>
<li><a class="reference internal" href="#proxy-models">Proxy models</a></li>
<li><a class="reference internal" href="#deferred-fields">Deferred fields</a></li>
</ul>
</li>
<li><a class="reference internal" href="#testing-improvements">Testing improvements</a><ul>
<li><a class="reference internal" href="#test-performance-improvements">Test performance improvements</a></li>
</ul>
</li>
<li><a class="reference internal" href="#test-client-improvements">Test client improvements</a></li>
<li><a class="reference internal" href="#new-admin-features">New admin features</a><ul>
<li><a class="reference internal" href="#editable-fields-on-the-change-list">Editable fields on the change list</a></li>
<li><a class="reference internal" href="#admin-actions">Admin &#8220;actions&#8221;</a></li>
</ul>
</li>
<li><a class="reference internal" href="#conditional-view-processing">Conditional view processing</a></li>
<li><a class="reference internal" href="#url-namespaces">URL namespaces</a></li>
<li><a class="reference internal" href="#geodjango">GeoDjango</a></li>
<li><a class="reference internal" href="#other-improvements">Other improvements</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-s-next">What&#8217;s next?</a></li>
</ul>
</li>
</ul>

  <h3>Browse</h3>
  <ul>
    
      <li>Prev: <a href="1.1.2.html">Django 1.1.2 release notes</a></li>
    
    
      <li>Next: <a href="1.0.2.html">Django 1.0.2 release notes</a></li>
    
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="../index.html">Django v1.2 documentation</a>
        
          <ul><li><a href="index.html">Release notes</a>
        
        <ul><li>Django 1.1 release notes</li></ul>
        </li></ul>
      </li>
  </ul>  

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/releases/1.1.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Oct 20, 2010</p>
          </div> 
        
      
    </div>
    
    <div id="ft">
      <div class="nav">
    &laquo; <a href="1.1.2.html" title="Django 1.1.2 release notes">previous</a> 
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="1.0.2.html" title="Django 1.0.2 release notes">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>