Fixed #7210 -- Added F() expressions to query language. See the documentation for details on usage.

Many thanks to:
    * Nicolas Lara, who worked on this feature during the 2008 Google Summer of Code.
    * Alex Gaynor for his help debugging and fixing a number of issues.
    * Malcolm Tredinnick for his invaluable review notes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-01-29 10:46:36 +00:00
parent 08dd4176ed
commit cf37e4624a
16 changed files with 586 additions and 48 deletions

View file

@ -163,7 +163,7 @@ table (usually called ``django_session`` and the table
Connecting to the database
--------------------------
Refer to the :ref:`settings documentation <ref-settings>`.
Refer to the :ref:`settings documentation <ref-settings>`.
Connection settings are used in this order:
@ -262,9 +262,9 @@ of whether ``unique=True`` is specified or not.
.. _sqlite-notes:
SQLite notes
============
SQLite notes
============
SQLite_ provides an excellent development alternative for applications that
are predominantly read-only or require a smaller installation footprint. As
with all database servers, though, there are some differences that are
@ -294,21 +294,21 @@ the ``extra()`` QuerySet method. The bug can be identified by the error message
``OperationalError: ORDER BY terms must not be non-integer constants``. The
problem can be solved updating SQLite to version 3.3.6 or newer, possibly also
updating the ``pysqlite2`` Python module in the process.
.. _contain a bug: http://www.sqlite.org/cvstrac/tktview?tn=1768
This has a very low impact because 3.3.6 was released in April 2006, so most
current binary distributions for different platforms include newer version of
SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3``
modules.
However, in the case of Windows, the official binary distribution of the stable
release of Python 2.5 (2.5.2, as of this writing) includes SQLite 3.3.4, so the bug can
make itself evident in that platform. There are (as of Django 1.0) even three
tests in the Django test suite that will fail when run under this setup. As
described above, this can be solved by downloading and installing a newer
version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and
uses a newer version of SQLite. Python 2.6 ships with a newer version of
.. _contain a bug: http://www.sqlite.org/cvstrac/tktview?tn=1768
This has a very low impact because 3.3.6 was released in April 2006, so most
current binary distributions for different platforms include newer version of
SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3``
modules.
However, in the case of Windows, the official binary distribution of the stable
release of Python 2.5 (2.5.2, as of this writing) includes SQLite 3.3.4, so the bug can
make itself evident in that platform. There are (as of Django 1.0) even three
tests in the Django test suite that will fail when run under this setup. As
described above, this can be solved by downloading and installing a newer
version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and
uses a newer version of SQLite. Python 2.6 ships with a newer version of
SQLite and is not affected by this issue.
If you are in such platform and find yourself in the need to update
@ -317,6 +317,23 @@ If you are in such platform and find yourself in the need to update
attempts to import ``pysqlite2`` before than ``sqlite3`` and so it can take
advantage of the new ``pysqlite2``/SQLite versions.
Version 3.5.9
-------------
The Ubuntu "Intrepid Ibex" SQLite 3.5.9-3 package contains a bug that causes
problems with the evaluation of query expressions. If you are using Ubuntu
"Intrepid Ibex", you will need to find an alternate source for SQLite
packages, or install SQLite from source.
At one time, Debian Lenny shipped with the same malfunctioning SQLite 3.5.9-3
package. However the Debian project has subsequently issued updated versions
of the SQLite package that correct these bugs. If you find you are getting
unexpected results under Debian, ensure you have updated your SQLite package
to 3.5.9-5 or later.
The problem does not appear to exist with other versions of SQLite packaged
with other operating systems.
Version 3.6.2
--------------
@ -348,14 +365,14 @@ database user must have privileges to run the following commands:
* CREATE SEQUENCE
* CREATE PROCEDURE
* CREATE TRIGGER
To run Django's test suite, the user needs these *additional* privileges:
* CREATE USER
* DROP USER
* CREATE TABLESPACE
* DROP TABLESPACE
Connecting to the database
--------------------------